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 fc26435 + bd7b567 commit 7b204a8Copy full SHA for 7b204a8
compat/mingw.c
@@ -3092,9 +3092,20 @@ static void setup_windows_environment(void)
3092
convert_slashes(tmp);
3093
}
3094
3095
- /* simulate TERM to enable auto-color (see color.c) */
3096
- if (!getenv("TERM"))
3097
- setenv("TERM", "cygwin", 1);
+
+ /*
+ * 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
3109
3110
/* calculate HOME if not set */
3111
if (!getenv("HOME")) {
0 commit comments