mirror of
https://github.com/sharkdp/hexyl.git
synced 2026-10-30 09:05:54 +00:00
Replace atty with is-terminal
This commit is contained in:
1 parent
8d3aa65134
commit
188e753675
3 files changed
+30
-76
No files matched your search
+2
-2
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user