diff --git a/Cargo.toml b/Cargo.toml index a35ce3b..c625e2b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,5 @@ resolve-modules = ["regex"] [dependencies] termcolor = "1.0" -atty = "0.2" backtrace = "0.3" regex = { version = "1.4", optional = true } diff --git a/src/lib.rs b/src/lib.rs index 54f4db0..eca2351 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -38,7 +38,7 @@ use std::env; use std::fs::File; -use std::io::{BufRead, BufReader, ErrorKind}; +use std::io::{BufRead, BufReader, ErrorKind, IsTerminal as _}; use std::panic::PanicInfo; use std::path::PathBuf; use std::sync::{Arc, Mutex}; @@ -114,7 +114,7 @@ pub fn install() { /// If stderr is attached to a tty, this is a colorized stderr, else it's /// a plain (colorless) stderr. pub fn default_output_stream() -> Box { - Box::new(StandardStream::stderr(if atty::is(atty::Stream::Stderr) { + Box::new(StandardStream::stderr(if std::io::stderr().is_terminal() { ColorChoice::Always } else { ColorChoice::Never