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 @@ -2923,9 +2923,20 @@ static void setup_windows_environment(void)
2923
2923
convert_slashes (tmp );
2924
2924
}
2925
2925
2926
- /* simulate TERM to enable auto-color (see color.c) */
2927
- if (!getenv ("TERM" ))
2928
- setenv ("TERM" , "cygwin" , 1 );
2926
+
2927
+ /*
2928
+ * Make sure TERM is set up correctly to enable auto-color
2929
+ * (see color.c .) Use "cygwin" for older OS releases which
2930
+ * works correctly with MSYS2 utilities on older consoles.
2931
+ */
2932
+ if (!getenv ("TERM" )) {
2933
+ if ((GetVersion () >> 16 ) < 15063 )
2934
+ setenv ("TERM" , "cygwin" , 0 );
2935
+ else {
2936
+ setenv ("TERM" , "xterm-256color" , 0 );
2937
+ setenv ("COLORTERM" , "truecolor" , 0 );
2938
+ }
2939
+ }
2929
2940
2930
2941
/* calculate HOME if not set */
2931
2942
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments