[ty] Enable virtual terminal on Windows (#19984)

## Summary

Should hopefully fix https://github.com/astral-sh/ty/issues/1045
This commit is contained in:
David Peter 2025-08-19 11:13:03 +02:00 committed by GitHub
parent 4242905b36
commit 10301f6190
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -62,6 +62,10 @@ pub(crate) fn version() -> Result<()> {
}
fn run_check(args: CheckCommand) -> anyhow::Result<ExitStatus> {
// Enabled ANSI colors on Windows 10.
#[cfg(windows)]
assert!(colored::control::set_virtual_terminal(true).is_ok());
set_colored_override(args.color);
let verbosity = args.verbosity.level();