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