summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorKarsten Blees <blees@dcon.de>2014-07-17 15:38:06 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-21 16:32:50 (GMT)
commitbaea068d677fae92d7903e984cf93bbd5195a000 (patch)
treed5c31ff7b5119067f7359e65f204243a843c9a4e /compat/mingw.c
parent6dc715439b8e9ec85d6412750665431dd6a5afc6 (diff)
downloadgit-baea068d677fae92d7903e984cf93bbd5195a000.zip
git-baea068d677fae92d7903e984cf93bbd5195a000.tar.gz
git-baea068d677fae92d7903e984cf93bbd5195a000.tar.bz2
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>
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 74c6180..df0fa03 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);