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 @@ -2955,9 +2955,20 @@ static void setup_windows_environment(void)
2955
2955
convert_slashes (tmp );
2956
2956
}
2957
2957
2958
- /* simulate TERM to enable auto-color (see color.c) */
2959
- if (!getenv ("TERM" ))
2960
- setenv ("TERM" , "cygwin" , 1 );
2958
+
2959
+ /*
2960
+ * Make sure TERM is set up correctly to enable auto-color
2961
+ * (see color.c .) Use "cygwin" for older OS releases which
2962
+ * works correctly with MSYS2 utilities on older consoles.
2963
+ */
2964
+ if (!getenv ("TERM" )) {
2965
+ if ((GetVersion () >> 16 ) < 15063 )
2966
+ setenv ("TERM" , "cygwin" , 0 );
2967
+ else {
2968
+ setenv ("TERM" , "xterm-256color" , 0 );
2969
+ setenv ("COLORTERM" , "truecolor" , 0 );
2970
+ }
2971
+ }
2961
2972
2962
2973
/* calculate HOME if not set */
2963
2974
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments