Skip to content

Commit

Permalink
Automatically rewrite TERM=msys to TERM=cygwin
Browse files Browse the repository at this point in the history
With MSys1, it was necessary to set the TERM variable to "msys". To
allow for a smooth transition from MSys1 to MSys2, let's simply handle
TERM=msys as if the user had not specified TERM at all and wanted us to
use our preferred TERM value.
  • Loading branch information
Alexpux authored and lazka committed Dec 11, 2022
1 parent 2de07ae commit 5fa487e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion winsup/cygwin/environ.cc
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,16 @@ win32env_to_cygenv (PWCHAR rawenv, bool posify)
char *eq = strchrnul (newp, '=');
ucenv (newp, eq); /* uppercase env vars which need it */
if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0)
sawTERM = 1;
{
/* backwards compatibility: override TERM=msys by TERM=cygwin */
if (strcmp (newp + 5, "msys") == 0)
{
free(newp);
i--;
continue;
}
sawTERM = 1;
}
#ifdef __MSYS__
else if (*newp == 'M' && strncmp (newp, "MSYS=", 5) == 0)
parse_options (newp + 5);
Expand Down

0 comments on commit 5fa487e

Please sign in to comment.