Win32: enable color output in Windows cmd.exe
Git requires the TERM environment variable to be set for all color* settings. Simulate the TERM variable if it is not set (default on Windows). Signed-off-by: Karsten Blees <blees@dcon.de> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Stepan Kasal <kasal@ucw.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karsten Blees committed
Jul 17, 2014 at 17:38 UTC
baea068d677fae92d7903e984cf93bbd5195a000
1 file changed
+4
compat/mingw.c
+4
@@ -2113,6 +2113,10 @@ void mingw_startup()
2113
setenv("TMPDIR", tmp, 1);
2114
}
2115
2116
+ /* simulate TERM to enable auto-color (see color.c) */
2117
+ if (!getenv("TERM"))
2118
+ setenv("TERM", "cygwin", 1);
2119
+
2120
/* initialize critical section for waitpid pinfo_t list */
2121
InitializeCriticalSection(&pinfo_cs);
2122