From 4f00f0b1c9fb9a3054ef72603ed2e9a78d130bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= Date: Tue, 22 Nov 2022 11:09:10 +0100 Subject: [PATCH] chore: replace atty with is-terminal --- Cargo.toml | 2 +- src/lib.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 001a9c81..03da2380 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ serde = "1.0" serde_json = "1.0" serde_derive = "1.0" ciborium = "0.2.0" -atty = "0.2.6" +is-terminal = "0.4.6" clap = { version = "3.1", default-features = false, features = ["std"] } walkdir = "2.3" tinytemplate = "1.1" diff --git a/src/lib.rs b/src/lib.rs index dcabae03..d81fe453 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,6 +36,7 @@ extern crate approx; #[cfg(test)] extern crate quickcheck; +use is_terminal::IsTerminal; use regex::Regex; #[cfg(feature = "real_blackbox")] @@ -76,6 +77,7 @@ use std::cell::RefCell; use std::collections::HashSet; use std::default::Default; use std::env; +use std::io::stdout; use std::net::TcpStream; use std::path::{Path, PathBuf}; use std::process::Command; @@ -1060,7 +1062,7 @@ https://bheisler.github.io/criterion.rs/book/faq.html } else { CliVerbosity::Normal }; - let stdout_isatty = atty::is(atty::Stream::Stdout); + let stdout_isatty = stdout().is_terminal(); let mut enable_text_overwrite = stdout_isatty && !verbose && !debug_enabled(); let enable_text_coloring; match matches.value_of("color") {