Skip to content

Commit

Permalink
Don't use colored output on MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
inetic committed Jun 13, 2024
1 parent 05e458d commit 2a907ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bridge/src/logger/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ impl Inner {
LogColor::Never => false,
LogColor::Auto => {
// Disable colors in output on Windows as `cmd` doesn't seem to support it.
// Also for MacOS, colors work in the terminal, but not in xcode and even in
// xcode the below `is_terminal()` returns true.
//
// TODO: consider using `ansi_term::enable_ansi_support()`
// (see https://github.com/ogham/rust-ansi-term#basic-usage for more info)
!cfg!(target_os = "windows") && io::stdout().is_terminal()
!cfg!(any(target_os = "windows", target_os = "macos")) && io::stdout().is_terminal()
}
};

Expand Down

0 comments on commit 2a907ad

Please sign in to comment.