Skip to content

Commit baea068

Browse files
kbleesgitster
authored andcommitted
Win32: 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]> Signed-off-by: Stepan Kasal <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6dc7154 commit baea068

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
@@ -2113,6 +2113,10 @@ void mingw_startup()
21132113
setenv("TMPDIR", tmp, 1);
21142114
}
21152115

2116+
/* simulate TERM to enable auto-color (see color.c) */
2117+
if (!getenv("TERM"))
2118+
setenv("TERM", "cygwin", 1);
2119+
21162120
/* initialize critical section for waitpid pinfo_t list */
21172121
InitializeCriticalSection(&pinfo_cs);
21182122

0 commit comments

Comments
 (0)