Skip to content

Commit

Permalink
fix: setting NO_COLOR should not print ansi codes for non-terminals
Browse files Browse the repository at this point in the history
closes #380
  • Loading branch information
Boshen committed Jun 11, 2024
1 parent b82cc81 commit b30ef81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handlers/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,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 b30ef81

Please sign in to comment.