Skip to content

Commit

Permalink
fix(diagnostics): do not print ansi color codes in non-TTYs (#3624)
Browse files Browse the repository at this point in the history
closes #3539

upstream issue zkat/miette#380
  • Loading branch information
Boshen committed Jun 11, 2024
1 parent f9c08d1 commit e6ad3fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_diagnostics/src/graphical_theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit e6ad3fb

Please sign in to comment.