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