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 @@ -2939,9 +2939,20 @@ static void setup_windows_environment(void)
2939
2939
convert_slashes (tmp );
2940
2940
}
2941
2941
2942
- /* simulate TERM to enable auto-color (see color.c) */
2943
- if (!getenv ("TERM" ))
2944
- setenv ("TERM" , "cygwin" , 1 );
2942
+
2943
+ /*
2944
+ * Make sure TERM is set up correctly to enable auto-color
2945
+ * (see color.c .) Use "cygwin" for older OS releases which
2946
+ * works correctly with MSYS2 utilities on older consoles.
2947
+ */
2948
+ if (!getenv ("TERM" )) {
2949
+ if ((GetVersion () >> 16 ) < 15063 )
2950
+ setenv ("TERM" , "cygwin" , 0 );
2951
+ else {
2952
+ setenv ("TERM" , "xterm-256color" , 0 );
2953
+ setenv ("COLORTERM" , "truecolor" , 0 );
2954
+ }
2955
+ }
2945
2956
2946
2957
/* calculate HOME if not set */
2947
2958
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments