##// END OF EJS Templates
color: be more conservative about setting ANSI mode on Windows (BC)...
color: be more conservative about setting ANSI mode on Windows (BC) The current color mode detection on Windows assumes the presence of the TERM environment variable assumes ANSI is supported. However, this isn't always true. In MSYS (commonly found as part of MinGW), TERM is set to "cygwin" and the auto resolved color mode of "ansi" results in escape sequences getting printed literally to the terminal. The output is very difficult to read and results in a bad user experience. A workaround is to activate the pager and have it attend all commands (GNU less in MSYS can render ANSI terminal sequences properly). In Cygwin, TERM is set to "xterm." Furthermore, Cygwin supports displaying these terminal sequences properly (unlike MSYS). This patch changes the mode auto-detection logic on Windows to be more conservative about selecting the "ansi" mode. We now only select the "ansi" mode if TERM is set and it contains the string "xterm" or if we were unable to talk to win32 APIs to determine the settings. There is a chance this may take away "ansi" from a terminal that actually supports it. The recourse for this would be to patch the detection to act appropriately and to override color.mode until that patch has landed. However, the author believes this regression is tolerable, since it means MSYS users won't have gibberish printed by default. Since MSYS's common pager (less) supports display of ANSI sequences, there is room to patch the color extensions so it can select the ANSI color mode if a pager is activated. Mozilla (being an active user of MSYS) would really appreciate this being part of the stable branch. However, since I believe it is BC, I haven't explicitly requested application to stable since I figure that request will be denied.
Gregory Szorc -
r24028:a78888d9 default
Show More
Name Size Modified Last Commit Author
contrib
doc
hgext
i18n
mercurial
tests
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Mercurial
=========

Mercurial is a fast, easy to use, distributed revision control tool
for software developers.

Basic install:

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

Running without installing:

$ make local # build for inplace usage
$ ./hg --version # should show the latest version

See http://mercurial.selenic.com/ for detailed installation
instructions, platform-specific notes, and Mercurial user information.