Replace atty with is-terminal

This commit is contained in:
Sharif Haason committed 2022-12-04 21:42:44 -05:00
1 parent 8d3aa65134
commit 188e753675
3 files changed
+30 -76

No files matched your search

+2 -2
View File
@@ -9,7 +9,7 @@ use std::num::{NonZeroI64, NonZeroU64, NonZeroU8};
use clap::builder::ArgPredicate;
use clap::{crate_name, crate_version, Arg, ArgAction, ColorChoice, Command};
use atty::Stream;
use is_terminal::IsTerminal;
use anyhow::{anyhow, Context, Error as AnyhowError};
@@ -281,7 +281,7 @@ fn run() -> Result<(), AnyhowError> {
let show_color = match matches.get_one::<String>("color").map(String::as_ref) {
Some("never") => false,
Some("auto") => atty::is(Stream::Stdout),
Some("auto") => std::io::stdout().is_terminal(),
_ => true,
};