Mercurial > hg-stable
view rustfmt.toml @ 48746:fd2cf9e0c64e
color: don't infer vt status from TERM on Windows
Previously, it was assumed that Windows environments with
"xterm" in the TERM environment variable meant that either
"virtual terminal mode" was already enabled, or that
we are running in an environment that didn't need a "virtual
terminal mode" (such as mintty, that interprets ANSI sequences
itself).
However, modern Cygwin and MSYS2 set TERM=xterm when using the
Command Prompt as the terminal, which needs "virtual terminal
mode" to be manually enabled. However, due to (issue6640),
the vtmode wasn't being enabled.
This patch ensures that we always try to enable vtmode on
Windows regardless of the state of TERM, so that:
* ANSI-based colors work in modern Cygwin/MSYS2 (with Command
Prompt), and
* The vtmode is unnecessarily set when running in a different
terminal such as mintty, but it is simply redundant and doesn't
appear to have ill effects.
Differential Revision: https://phab.mercurial-scm.org/D12158
author | Mitchell Hentges <mhentges@mozilla.com> |
---|---|
date | Wed, 09 Feb 2022 13:04:37 -0500 |
parents | 426294d06ddc |
children |
line wrap: on
line source
edition = "2018" max_width = 79 wrap_comments = true error_on_line_overflow = true