We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b0a6f82 + f8248ab commit 4d4ee58Copy full SHA for 4d4ee58
compat/mingw.c
@@ -3378,9 +3378,20 @@ static void setup_windows_environment(void)
3378
convert_slashes(tmp);
3379
}
3380
3381
- /* simulate TERM to enable auto-color (see color.c) */
3382
- if (!getenv("TERM"))
3383
- setenv("TERM", "cygwin", 1);
+
+ /*
+ * 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
3395
3396
/* calculate HOME if not set */
3397
if (!getenv("HOME")) {
0 commit comments