summaryrefslogtreecommitdiff
path: root/runtime/colors.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2023-08-25 07:43:07 -0600
committerGitHub <noreply@github.com>2023-08-25 07:43:07 -0600
commitc272d26ae84ddf8ce1aa0456fbecedff102a64b0 (patch)
tree286eb981bd742ad0fd94b1aae08dfbc24b36b854 /runtime/colors.rs
parent9e31f9452e0b91816b9114f17e7aaa5c226b9337 (diff)
chore(cli): remove atty crate (#20275)
Removes a crate with an outstanding vulnerability.
Diffstat (limited to 'runtime/colors.rs')
-rw-r--r--runtime/colors.rs4
1 files changed, 2 insertions, 2 deletions
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<bool> =
Lazy::new(|| std::env::var_os("NO_COLOR").is_some());
-static IS_TTY: Lazy<bool> = Lazy::new(|| atty::is(atty::Stream::Stdout));
+static IS_TTY: Lazy<bool> = Lazy::new(|| std::io::stdout().is_terminal());
pub fn is_tty() -> bool {
*IS_TTY