From 76c15c6b55c09ae30432b3712c0018625a9bb536 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Fri, 17 Mar 2023 14:24:06 -0400 Subject: [PATCH] Enable ANSI colors on Windows 10 --- crates/ruff_cli/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ruff_cli/src/lib.rs b/crates/ruff_cli/src/lib.rs index 0fce84ded8423..b817d0df67f30 100644 --- a/crates/ruff_cli/src/lib.rs +++ b/crates/ruff_cli/src/lib.rs @@ -69,6 +69,10 @@ quoting the executed command, along with the relevant file contents and `pyproje })); } + // Enabled ANSI colors on Windows 10. + #[cfg(windows)] + assert!(colored::control::set_virtual_terminal(true).is_ok()); + let log_level: LogLevel = (&log_level_args).into(); set_up_logging(&log_level)?;