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 dscho committed Apr 6, 2024
1 parent 45c5946 commit 474f787
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 @@ -908,7 +908,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 474f787

Please sign in to comment.