summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Karsten Blees <blees@dcon.de>2014-07-17 17:38:06 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-07-21 09:32:50 -0700
commitbaea068d677fae92d7903e984cf93bbd5195a000 (patch)
treed5c31ff7b5119067f7359e65f204243a843c9a4e
parentWin32: patch Windows environment on startup (diff)
downloadtgif-baea068d677fae92d7903e984cf93bbd5195a000.tar.xz
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>
-rw-r--r--compat/mingw.c4
1 files changed, 4 insertions, 0 deletions
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);