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