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 @@ -2902,9 +2902,20 @@ static void setup_windows_environment(void)
2902
2902
convert_slashes (tmp );
2903
2903
}
2904
2904
2905
- /* simulate TERM to enable auto-color (see color.c) */
2906
- if (!getenv ("TERM" ))
2907
- setenv ("TERM" , "cygwin" , 1 );
2905
+
2906
+ /*
2907
+ * Make sure TERM is set up correctly to enable auto-color
2908
+ * (see color.c .) Use "cygwin" for older OS releases which
2909
+ * works correctly with MSYS2 utilities on older consoles.
2910
+ */
2911
+ if (!getenv ("TERM" )) {
2912
+ if ((GetVersion () >> 16 ) < 15063 )
2913
+ setenv ("TERM" , "cygwin" , 0 );
2914
+ else {
2915
+ setenv ("TERM" , "xterm-256color" , 0 );
2916
+ setenv ("COLORTERM" , "truecolor" , 0 );
2917
+ }
2918
+ }
2908
2919
2909
2920
/* calculate HOME if not set */
2910
2921
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments