Skip to content

Commit c6da01a

Browse files
committed
patch 8.0.1071: putty-color and cygwin-color are not recognized
Problem: $TERM names starting with "putty" and "cygwin" are likely to have a dark background, but are not recognized. Solution: Only check the first few characters of $TERM to match "putty" or "cygwin". (Christian Brabandt)
1 parent 75a60f7 commit c6da01a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/option.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4024,8 +4024,8 @@ set_init_2(void)
40244024
* This is just guessing! Recognized are:
40254025
* "linux" Linux console
40264026
* "screen.linux" Linux console with screen
4027-
* "cygwin" Cygwin shell
4028-
* "putty" Putty program
4027+
* "cygwin.*" Cygwin shell
4028+
* "putty.*" Putty program
40294029
* We also check the COLORFGBG environment variable, which is set by
40304030
* rxvt and derivatives. This variable contains either two or three
40314031
* values separated by semicolons; we want the last value in either
@@ -4035,15 +4035,15 @@ set_init_2(void)
40354035
term_bg_default(void)
40364036
{
40374037
#if defined(WIN3264)
4038-
/* DOS console nearly always black */
4038+
/* DOS console is nearly always black */
40394039
return (char_u *)"dark";
40404040
#else
40414041
char_u *p;
40424042

40434043
if (STRCMP(T_NAME, "linux") == 0
40444044
|| STRCMP(T_NAME, "screen.linux") == 0
4045-
|| STRCMP(T_NAME, "cygwin") == 0
4046-
|| STRCMP(T_NAME, "putty") == 0
4045+
|| STRNCMP(T_NAME, "cygwin", 6) == 0
4046+
|| STRNCMP(T_NAME, "putty", 5) == 0
40474047
|| ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL
40484048
&& (p = vim_strrchr(p, ';')) != NULL
40494049
&& ((p[1] >= '0' && p[1] <= '6') || p[1] == '8')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ static char *(features[]) =
769769

770770
static int included_patches[] =
771771
{ /* Add new patch number below this line */
772+
/**/
773+
1071,
772774
/**/
773775
1070,
774776
/**/

0 commit comments

Comments
 (0)