From c272d26ae84ddf8ce1aa0456fbecedff102a64b0 Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Fri, 25 Aug 2023 07:43:07 -0600 Subject: chore(cli): remove atty crate (#20275) Removes a crate with an outstanding vulnerability. --- runtime/colors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/colors.rs') diff --git a/runtime/colors.rs b/runtime/colors.rs index a9ad12e8c..fe5a3dcbe 100644 --- a/runtime/colors.rs +++ b/runtime/colors.rs @@ -1,8 +1,8 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -use atty; use once_cell::sync::Lazy; use std::fmt; +use std::io::IsTerminal; use std::io::Write; use termcolor::Ansi; use termcolor::Color::Ansi256; @@ -25,7 +25,7 @@ use termcolor::ColorChoice; static NO_COLOR: Lazy = Lazy::new(|| std::env::var_os("NO_COLOR").is_some()); -static IS_TTY: Lazy = Lazy::new(|| atty::is(atty::Stream::Stdout)); +static IS_TTY: Lazy = Lazy::new(|| std::io::stdout().is_terminal()); pub fn is_tty() -> bool { *IS_TTY -- cgit v1.2.3