From d64a31c018a204aca42940ee4b067c4bb5fee88a 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 16a99b8002..2639f7fe2f 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -1264,6 +1264,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; }