[Bug 6051] New: Color on stderr falls back to ANSI on Windows with stdout redirected to N

mercurial-bugs at mercurial-scm.org mercurial-bugs at mercurial-scm.org
Thu Jan 10 21:27:00 UTC 2019


https://bz.mercurial-scm.org/show_bug.cgi?id=6051

            Bug ID: 6051
           Summary: Color on stderr falls back to ANSI on Windows with
                    stdout redirected to N
           Product: Mercurial
           Version: 4.8.1
          Hardware: PC
                OS: Windows
            Status: UNCONFIRMED
          Severity: bug
          Priority: normal
         Component: color
          Assignee: bugzilla at mercurial-scm.org
          Reporter: matt_harbison at yahoo.com
                CC: mercurial-devel at mercurial-scm.org

$ hg log -r 100000000
abort: unknown revision '100000000'!   <-- text in red

$ ../hg log -r 100000000 >/dev/null
←[0;31mabort: unknown revision '100000000'!←[0m

Interestingly, the error text is also mangled on Windows 10.  There must be
more to it than only checking stdout in win32.enablevtmode(), because changing
that to stderr has no effect.

If the redirect is to a file, there are no ANSI codes in the output, but no
color either (on either Win7 or Win10).  Maybe it's related to NUL being
reported as a tty?  But I'm not sure why it wouldn't stick with win32 color
mode.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list