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 @@ -3091,9 +3091,20 @@ static void setup_windows_environment(void)
3091
3091
convert_slashes (tmp );
3092
3092
}
3093
3093
3094
- /* simulate TERM to enable auto-color (see color.c) */
3095
- if (!getenv ("TERM" ))
3096
- setenv ("TERM" , "cygwin" , 1 );
3094
+
3095
+ /*
3096
+ * Make sure TERM is set up correctly to enable auto-color
3097
+ * (see color.c .) Use "cygwin" for older OS releases which
3098
+ * works correctly with MSYS2 utilities on older consoles.
3099
+ */
3100
+ if (!getenv ("TERM" )) {
3101
+ if ((GetVersion () >> 16 ) < 15063 )
3102
+ setenv ("TERM" , "cygwin" , 0 );
3103
+ else {
3104
+ setenv ("TERM" , "xterm-256color" , 0 );
3105
+ setenv ("COLORTERM" , "truecolor" , 0 );
3106
+ }
3107
+ }
3097
3108
3098
3109
/* calculate HOME if not set */
3099
3110
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments