From bd5b9a04eb0e809fe212890606937c79c8936d6e Mon Sep 17 00:00:00 2001 From: Boshen Date: Tue, 11 Jun 2024 16:05:29 +0800 Subject: [PATCH] fix(diagnostics): do not print ansi color codes in non-terminals 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 49a4ee1225c40..11455c2180452 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(),