Skip to content

Commit

Permalink
Win32: enable color output in Windows cmd.exe
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
kblees authored and gitster committed Jul 21, 2014
1 parent 6dc7154 commit baea068
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compat/mingw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,6 +2113,10 @@ void mingw_startup()
setenv("TMPDIR", tmp, 1);
}

/* simulate TERM to enable auto-color (see color.c) */
if (!getenv("TERM"))
setenv("TERM", "cygwin", 1);

/* initialize critical section for waitpid pinfo_t list */
InitializeCriticalSection(&pinfo_cs);

Expand Down

0 comments on commit baea068

Please sign in to comment.