From: Karsten Blees Date: Thu, 17 Jul 2014 15:38:06 +0000 (+0200) Subject: Win32: enable color output in Windows cmd.exe X-Git-Tag: v2.1.0-rc1~7^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=baea068d677fae92d7903e984cf93bbd5195a000;p=git 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 Signed-off-by: Johannes Schindelin Signed-off-by: Stepan Kasal Signed-off-by: Junio C Hamano --- diff --git a/compat/mingw.c b/compat/mingw.c index 74c6180a20..df0fa03194 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2113,6 +2113,10 @@ void mingw_startup() setenv("TMPDIR", tmp, 1); } + /* simulate TERM to enable auto-color (see color.c) */ + if (!getenv("TERM")) + setenv("TERM", "cygwin", 1); + /* initialize critical section for waitpid pinfo_t list */ InitializeCriticalSection(&pinfo_cs);