summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorKarsten Blees <blees@dcon.de>2014-07-17 17:38:06 +0200
committerJunio C Hamano <gitster@pobox.com>2014-07-21 09:32:50 -0700
commitbaea068d677fae92d7903e984cf93bbd5195a000 (patch)
treed5c31ff7b5119067f7359e65f204243a843c9a4e /compat
parent6dc715439b8e9ec85d6412750665431dd6a5afc6 (diff)
downloadgit-baea068d677fae92d7903e984cf93bbd5195a000.tar.gz
Win32: enable color output in Windows cmd.exesk/mingw-uni-fix-more
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>
Diffstat (limited to 'compat')
-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);