File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -2911,9 +2911,20 @@ static void setup_windows_environment(void)
2911
2911
convert_slashes (tmp );
2912
2912
}
2913
2913
2914
- /* simulate TERM to enable auto-color (see color.c) */
2915
- if (!getenv ("TERM" ))
2916
- setenv ("TERM" , "cygwin" , 1 );
2914
+
2915
+ /*
2916
+ * Make sure TERM is set up correctly to enable auto-color
2917
+ * (see color.c .) Use "cygwin" for older OS releases which
2918
+ * works correctly with MSYS2 utilities on older consoles.
2919
+ */
2920
+ if (!getenv ("TERM" )) {
2921
+ if ((GetVersion () >> 16 ) < 15063 )
2922
+ setenv ("TERM" , "cygwin" , 0 );
2923
+ else {
2924
+ setenv ("TERM" , "xterm-256color" , 0 );
2925
+ setenv ("COLORTERM" , "truecolor" , 0 );
2926
+ }
2927
+ }
2917
2928
2918
2929
/* calculate HOME if not set */
2919
2930
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments