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