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