[ty] Enable virtual terminal on Windows by sharkdp · Pull Request #19984 · astral-sh/ruff (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment similar to ruff:

    // Enabled ANSI colors on Windows 10.
    #[cfg(windows)]
    assert!(colored::control::set_virtual_terminal(true).is_ok());

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, oops. I even searched for set_virtual_terminal and was surprised we didn't use it anywhere. Forgot to disable my crates/ty* filter ...

Made it consistent with what we have in ruff.