From e6ad3fbf1664dcd09b2841d2ea71e464f4d9b9c5 Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 11 Jun 2024 16:16:28 +0800 Subject: [PATCH] fix(diagnostics): do not print ansi color codes in non-TTYs (#3624) closes #3539 upstream issue https://github.com/zkat/miette/issues/380 --- crates/oxc_diagnostics/src/graphical_theme.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_diagnostics/src/graphical_theme.rs b/crates/oxc_diagnostics/src/graphical_theme.rs index 49a4ee122..11455c218 100644 --- a/crates/oxc_diagnostics/src/graphical_theme.rs +++ b/crates/oxc_diagnostics/src/graphical_theme.rs @@ -64,7 +64,7 @@ impl Default for GraphicalTheme { fn default() -> Self { match std::env::var("NO_COLOR") { _ if !std::io::stdout().is_terminal() || !std::io::stderr().is_terminal() => { - Self::ascii() + Self::none() } Ok(string) if string != "0" => Self::unicode_nocolor(), _ => Self::unicode(),