mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Remove dependency on atty and use std::io::IsTerminal instead
This commit is contained in:
1 parent
769652353a
commit
69ee1738d4
3 files changed
+3
-26
No files matched your search
+2
-2
@@ -1,10 +1,10 @@
|
||||
use std::fs::File;
|
||||
use std::io::IsTerminal;
|
||||
use std::path::PathBuf;
|
||||
use std::process::{Command, Stdio};
|
||||
use std::{cmp, env, fmt, io};
|
||||
|
||||
use anyhow::ensure;
|
||||
use atty::Stream;
|
||||
use clap::ArgMatches;
|
||||
|
||||
use crate::command::Commands;
|
||||
@@ -333,7 +333,7 @@ impl Options {
|
||||
Some("none") => OutputStyleOption::Disabled,
|
||||
_ => {
|
||||
if options.command_output_policy == CommandOutputPolicy::Inherit
|
||||
|| !atty::is(Stream::Stdout)
|
||||
|| !io::stdout().is_terminal()
|
||||
{
|
||||
OutputStyleOption::Basic
|
||||
} else if env::var_os("TERM")
|
||||
|
||||
Reference in new issue
Block a user