summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-12-11 16:23:30 +0100
committerGitHub <noreply@github.com>2021-12-11 16:23:30 +0100
commitaeadc29fcd08a8ef8d134c6b844c7b511339e7a9 (patch)
tree8fb219272284fd663919db851f09f6545fd375c4
parent0dec9b4381e0aa1d4b75ab5837cb75598f19c727 (diff)
Revert "fix(cli): don't add colors for non-tty outputs (#13031)" (#13054)
This reverts commit 38f163022373c9adb050f17140f7d29bb403abe2.
-rw-r--r--runtime/colors.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/runtime/colors.rs b/runtime/colors.rs
index 54bc0abe6..00241b4e0 100644
--- a/runtime/colors.rs
+++ b/runtime/colors.rs
@@ -9,14 +9,11 @@ use termcolor::{Ansi, ColorSpec, WriteColor};
use termcolor::{BufferWriter, ColorChoice};
lazy_static::lazy_static! {
-// checks if the output is piped to a tty
- static ref IS_TTY: bool = atty::is(atty::Stream::Stdout);
static ref NO_COLOR: bool = std::env::var_os("NO_COLOR").is_some();
}
-// if the output is piped to a tty, use color
pub fn use_color() -> bool {
- !(*NO_COLOR) && *IS_TTY
+ !(*NO_COLOR)
}
#[cfg(windows)]