When using zsh in Console2 on Windows, the colour extension tries to output ANSI colour codes instead of using the win32 API. When forcing color.mode=win32, it works but I get a warning ("warning: failed to set color mode to win32") if I try to send the output of hg through a pipe. I've currently worked around the issue by forcing color.mode=win32 and commenting out the warning in hgext/color.py:179
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:28 EDT --- This bug was previously known as _bug_ 3289 at http://mercurial.selenic.com/bts/issue3289 Bug Status was UNCONFIRMED but everconfirmed was true Setting status to CONFIRMED
OK, just to confirm: - You don't get any colorization by default. - If you run hg with color.mode=win32 and you *don't* pipe hg's output, you don't get any warnings from color and colorization works correctly. - If you run hg with color.mode=win32 and you *dO pipe hg's output, you get a warning from color and no colorization occurs. Is that right? If so, can you run echo $TERM and paste the output? If you've exported TERM (or if Console2 is doing that), that might be the cause of the first problem. The piping problem sounds like a separate issue.
(In reply to comment #2) That is correct. I should add that by default, there is no colorization but there are ANSI escape codes mixed with the output (codes like: "^[01;31m"). I'll check the value of TERM when I get back on the Windows computer on Monday.
Unassign some bugs with no activity.
It looks like zsh is exporting TERM=vt100: - Running "echo $TERM" in zsh prints "vt100" in Console2 as well as in the default windows console (cmd.exe). - Running "echo %TERM%" in cmd.exe prints "%TERM%" in Console2 as well as in the default console. - Searching for "vt100" in my configuration files does not find anything.
I don't think this is something we should fix on our end. If TERM is set, we should honor it, and we appear to be doing that. There are ways to get the color codes to work: http://linge-ma.ws/2011/08/better-cmd-exe-terminal-and-ansi-color-codes-support/