Use is_terminal from std lib?
jcamiel opened this issue · comments
Jean-Christophe Amiel commented
Hi,
In Rust 1.70, is_terminal
is available on std::io::stdout()/stderr()/stdin()
, maybe this is an opportunity to remove the atty
dependency?
In /colored/src/control.rs instead of:
ShouldColorize {
clicolor: ShouldColorize::normalize_env(env::var("CLICOLOR")).unwrap_or(true)
&& atty::is(atty::Stream::Stdout),
The code can be now:
ShouldColorize {
clicolor: ShouldColorize::normalize_env(env::var("CLICOLOR")).unwrap_or(true)
&& std::io::stdout().is_terminal(),
I can make a PR if needed!
Thanks,
Jean-Christophe Amiel commented
Ah sorry, I didn't check PR (#134), fill free to close mine!
Hunter Wittenborn commented
This is actually being discussed in #122 (comment) as well, an MSRV just needs to be decided on before figuring out if a crate or the stdlib will be used.
Feel free to track the issue linked in that PR for any updates :)