Skip to content

Commit

Permalink
Fix colors on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkdp committed Dec 27, 2024
1 parent c7f568b commit a36a2a8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions numbat-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ impl Cli {
}

fn run(&mut self) -> Result<()> {
// Enabled ANSI colors on Windows 10
#[cfg(windows)]
colored::control::set_virtual_terminal(true).unwrap();

match self.config.color {
ColorMode::Never => SHOULD_COLORIZE.set_override(false),
ColorMode::Always => SHOULD_COLORIZE.set_override(true),
Expand Down

0 comments on commit a36a2a8

Please sign in to comment.