mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Merge branch '1'
This commit is contained in:
commit
c4f7bbbd2b
2 files changed
+10
-1
No files matched your search
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
- Disable colorized output in case of `TERM=dumb` or `NO_COLOR=1`, see #542 and #555 (@nabijaczleweli)
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
|
|
||||||
|
|||||||
+9
-1
@@ -1,7 +1,7 @@
|
|||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::process::{Command, Stdio};
|
use std::process::{Command, Stdio};
|
||||||
use std::{cmp, fmt, io};
|
use std::{cmp, env, fmt, io};
|
||||||
|
|
||||||
use anyhow::ensure;
|
use anyhow::ensure;
|
||||||
use atty::Stream;
|
use atty::Stream;
|
||||||
@@ -298,6 +298,14 @@ impl Options {
|
|||||||
|| !atty::is(Stream::Stdout)
|
|| !atty::is(Stream::Stdout)
|
||||||
{
|
{
|
||||||
OutputStyleOption::Basic
|
OutputStyleOption::Basic
|
||||||
|
} else if env::var_os("TERM")
|
||||||
|
.map(|t| t == "unknown" || t == "dumb")
|
||||||
|
.unwrap_or(true)
|
||||||
|
|| env::var_os("NO_COLOR")
|
||||||
|
.map(|t| !t.is_empty())
|
||||||
|
.unwrap_or(false)
|
||||||
|
{
|
||||||
|
OutputStyleOption::NoColor
|
||||||
} else {
|
} else {
|
||||||
OutputStyleOption::Full
|
OutputStyleOption::Full
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user