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 7a81837 + a8d826b commit 3969125Copy full SHA for 3969125
compat/mingw.c
@@ -2964,9 +2964,20 @@ static void setup_windows_environment(void)
2964
convert_slashes(tmp);
2965
}
2966
2967
- /* simulate TERM to enable auto-color (see color.c) */
2968
- if (!getenv("TERM"))
2969
- setenv("TERM", "cygwin", 1);
+
+ /*
+ * Make sure TERM is set up correctly to enable auto-color
2970
+ * (see color.c .) Use "cygwin" for older OS releases which
2971
+ * works correctly with MSYS2 utilities on older consoles.
2972
+ */
2973
+ if (!getenv("TERM")) {
2974
+ if ((GetVersion() >> 16) < 15063)
2975
+ setenv("TERM", "cygwin", 0);
2976
+ else {
2977
+ setenv("TERM", "xterm-256color", 0);
2978
+ setenv("COLORTERM", "truecolor", 0);
2979
+ }
2980
2981
2982
/* calculate HOME if not set */
2983
if (!getenv("HOME")) {
0 commit comments