diff options
author | Thayne McCombs <astrothayne@gmail.com> | 2023-06-08 00:10:53 -0600 |
---|---|---|
committer | Thayne McCombs <astrothayne@gmail.com> | 2023-06-08 00:10:53 -0600 |
commit | 740edeb73f355a68b09bc43c3aed2a7a10572f2d (patch) | |
tree | bde66429463029a0f50c4a58f51ed876525f7df5 /src | |
parent | 91e3c3cba59e5d3f9d3dd36f06007355d3d8aff1 (diff) |
Replace atty with std
std now has a function for testing if stdout is a tty
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index eca1ad7..8c39a1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,12 +12,12 @@ mod regex_helper; mod walk; use std::env; +use std::io::IsTerminal; use std::path::Path; use std::sync::Arc; use std::time; use anyhow::{anyhow, bail, Context, Result}; -use atty::Stream; use clap::{CommandFactory, Parser}; use globset::GlobBuilder; use lscolors::LsColors; @@ -217,7 +217,7 @@ fn construct_config(mut opts: Opts, pattern_regexps: &[String]) -> Result<Config #[cfg(not(windows))] let ansi_colors_support = true; - let interactive_terminal = atty::is(Stream::Stdout); + let interactive_terminal = std::io::stdout().is_terminal(); let colored_output = match opts.color { ColorWhen::Always => true, ColorWhen::Never => false, |