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 @@ -3378,9 +3378,20 @@ static void setup_windows_environment(void)
3378
3378
convert_slashes (tmp );
3379
3379
}
3380
3380
3381
- /* simulate TERM to enable auto-color (see color.c) */
3382
- if (!getenv ("TERM" ))
3383
- setenv ("TERM" , "cygwin" , 1 );
3381
+
3382
+ /*
3383
+ * Make sure TERM is set up correctly to enable auto-color
3384
+ * (see color.c .) Use "cygwin" for older OS releases which
3385
+ * works correctly with MSYS2 utilities on older consoles.
3386
+ */
3387
+ if (!getenv ("TERM" )) {
3388
+ if ((GetVersion () >> 16 ) < 15063 )
3389
+ setenv ("TERM" , "cygwin" , 0 );
3390
+ else {
3391
+ setenv ("TERM" , "xterm-256color" , 0 );
3392
+ setenv ("COLORTERM" , "truecolor" , 0 );
3393
+ }
3394
+ }
3384
3395
3385
3396
/* calculate HOME if not set */
3386
3397
if (!getenv ("HOME" )) {
You can’t perform that action at this time.
0 commit comments