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>
This commit is contained in:
Karsten Blees
2010-07-31 00:04:00 +00:00
committed by Johannes Schindelin
parent 4de825ae30
commit 56fe11bb6c

View File

@@ -1207,6 +1207,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;
}