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