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 @@ -2918,9 +2918,20 @@ static void setup_windows_environment(void)
2918
2918
convert_slashes (tmp );
2919
2919
}
2920
2920
2921
- /* simulate TERM to enable auto-color (see color.c) */
2922
- if (!getenv ("TERM" ))
2923
- setenv ("TERM" , "cygwin" , 1 );
2921
+
2922
+ /*
2923
+ * Make sure TERM is set up correctly to enable auto-color
2924
+ * (see color.c .) Use "cygwin" for older OS releases which
2925
+ * works correctly with MSYS2 utilities on older consoles.
2926
+ */
2927
+ if (!getenv ("TERM" )) {
2928
+ if ((GetVersion () >> 16 ) < 15063 )
2929
+ setenv ("TERM" , "cygwin" , 0 );
2930
+ else {
2931
+ setenv ("TERM" , "xterm-256color" , 0 );
2932
+ setenv ("COLORTERM" , "truecolor" , 0 );
2933
+ }
2934
+ }
2924
2935
2925
2936
/* calculate HOME if not set */
2926
2937
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments