Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit dec299f

Browse files
kbleeskasal
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 47efdb2 commit dec299f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compat/mingw.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,10 @@ char *mingw_getenv(const char *name)
640640
if (!result)
641641
result = getenv("TEMP");
642642
}
643+
else if (!result && !strcmp(name, "TERM")) {
644+
/* simulate TERM to enable auto-color (see color.c) */
645+
result = "winansi";
646+
}
643647
return result;
644648
}
645649

0 commit comments

Comments
 (0)