From 08684f92ecba5a97e6296070aa5d0e524e25fa7e 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 5317071169..27a81f769c 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -640,6 +640,10 @@ char *mingw_getenv(const char *name) if (!result) result = getenv("TEMP"); } + else if (!result && !strcmp(name, "TERM")) { + /* simulate TERM to enable auto-color (see color.c) */ + result = "winansi"; + } return result; }