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