зеркало из https://github.com/microsoft/git.git
Merge pull request #3751 from rkitover/native-term
mingw: set $env:TERM=xterm-256color for newer OSes
This commit is contained in:
Коммит
1184dffef5
|
@ -2902,9 +2902,20 @@ static void setup_windows_environment(void)
|
||||||
convert_slashes(tmp);
|
convert_slashes(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* simulate TERM to enable auto-color (see color.c) */
|
|
||||||
if (!getenv("TERM"))
|
/*
|
||||||
setenv("TERM", "cygwin", 1);
|
* Make sure TERM is set up correctly to enable auto-color
|
||||||
|
* (see color.c .) Use "cygwin" for older OS releases which
|
||||||
|
* works correctly with MSYS2 utilities on older consoles.
|
||||||
|
*/
|
||||||
|
if (!getenv("TERM")) {
|
||||||
|
if ((GetVersion() >> 16) < 15063)
|
||||||
|
setenv("TERM", "cygwin", 0);
|
||||||
|
else {
|
||||||
|
setenv("TERM", "xterm-256color", 0);
|
||||||
|
setenv("COLORTERM", "truecolor", 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* calculate HOME if not set */
|
/* calculate HOME if not set */
|
||||||
if (!getenv("HOME")) {
|
if (!getenv("HOME")) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче