[Commented On] D12158: color: don't infer vt status from TERM on Windows

mitchhentgesmozilla (Mitchell Hentges) phabricator at mercurial-scm.org
Wed Feb 9 20:54:31 UTC 2022


mitchhentgesmozilla added a comment.


  In D12158#186352 <https://phab.mercurial-scm.org/D12158#186352>, @spectral wrote:
  
  > This really feels like a bug that they're advertising support for xterm-compatible escape codes, and then not setting everything up to handle it properly, but for all I know it's not possible for them to do so (i.e. maybe Windows requires that each Process enable vtmode for every Console it cares about, it can't be done "for us" by these tools)
  
  Yeah, it looks like Cygwin sets the term to xterm-256color <https://github.com/msys2/msys2-runtime/blob/c0250d576e39d603248d10e7bb2f396c9bc6a56c/winsup/cygwin/environ.cc#L963-L964> based on whether the console supports it, //not// based on whether it's currently active.
  I suppose that this makes sense considering that it's possible for children processes in the same terminal to `SetConsoleMode(...)` and enable/disable virtual terminal support without changing the `$TERM`.
  
  Going into more theoretical territory, my team is currently investigating an issue where it seems like each cygwin binary that runs is implicitly unsetting virtual terminal support, <https://bugzilla.mozilla.org/show_bug.cgi?id=1744340#c4> which could be related. However, even if that's changed, due to the malleable nature of "virtual terminal mode", I still think that aggresively enabling it in HG-land is a good idea :)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D12158/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D12158

To: mitchhentgesmozilla, #hg-reviewers, spectral
Cc: spectral, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20220209/a28c3402/attachment-0002.html>


More information about the Mercurial-patches mailing list