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