From 7b6e63b9899a625145f4311fbf19aa2881f9fc2e Mon Sep 17 00:00:00 2001 From: Karsten Blees Date: Sat, 31 Jul 2010 00:04:00 +0000 Subject: [PATCH] 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 --- compat/mingw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compat/mingw.c b/compat/mingw.c index a9e23c4842..db42488a1d 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1210,6 +1210,10 @@ char *mingw_getenv(const char *name) if (!result) result = getenv_cs("TEMP"); } + else if (!result && !strcmp(name, "TERM")) { + /* simulate TERM to enable auto-color (see color.c) */ + result = "winansi"; + } return result; } -- 2.11.4.GIT