Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: replace atty with is-terminal #628

Merged
merged 1 commit into from Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion src/lib.rs
Expand Up @@ -36,6 +36,7 @@ extern crate approx;
#[cfg(test)]
extern crate quickcheck;

use is_terminal::IsTerminal;
use regex::Regex;

#[cfg(feature = "real_blackbox")]
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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") {
Expand Down