Skip to content

Commit

Permalink
Respect --color=always even if we know it won't work
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasmohrin committed Nov 10, 2024
1 parent 859c97b commit 8a8253a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ fn main() {
// Determine the usage of styles
let enable_styles = match args.color.unwrap_or_default() {
// Attempt to use styling if instructed
ColorOptions::Always => true,
ColorOptions::Always => {
yansi::enable(); // disable yansi's automatic detection for ANSI support on Windows
true
}
// Enable styling if:
// * NO_COLOR env var isn't set: https://no-color.org/
// * The output stream is stdout (not being piped)
Expand Down

0 comments on commit 8a8253a

Please sign in to comment.