]> granicus.if.org Git - vim/commitdiff
patch 8.0.1071: putty-color and cygwin-color are not recognized v8.0.1071
authorBram Moolenaar <Bram@vim.org>
Thu, 7 Sep 2017 20:37:36 +0000 (22:37 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 7 Sep 2017 20:37:36 +0000 (22:37 +0200)
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)

src/option.c
src/version.c

index a1304c9447cb400784dc12e1e96fcfaa7f400b9d..a0367e73f49662e254fc15431b49c835095a8c1f 100644 (file)
@@ -4024,8 +4024,8 @@ set_init_2(void)
  * This is just guessing!  Recognized are:
  * "linux"         Linux console
  * "screen.linux"   Linux console with screen
- * "cygwin"        Cygwin shell
- * "putty"         Putty program
+ * "cygwin.*"      Cygwin shell
+ * "putty.*"       Putty program
  * We also check the COLORFGBG environment variable, which is set by
  * rxvt and derivatives. This variable contains either two or three
  * values separated by semicolons; we want the last value in either
@@ -4035,15 +4035,15 @@ set_init_2(void)
 term_bg_default(void)
 {
 #if defined(WIN3264)
-    /* DOS console nearly always black */
+    /* DOS console is nearly always black */
     return (char_u *)"dark";
 #else
     char_u     *p;
 
     if (STRCMP(T_NAME, "linux") == 0
            || STRCMP(T_NAME, "screen.linux") == 0
-           || STRCMP(T_NAME, "cygwin") == 0
-           || STRCMP(T_NAME, "putty") == 0
+           || STRNCMP(T_NAME, "cygwin", 6) == 0
+           || STRNCMP(T_NAME, "putty", 5) == 0
            || ((p = mch_getenv((char_u *)"COLORFGBG")) != NULL
                && (p = vim_strrchr(p, ';')) != NULL
                && ((p[1] >= '0' && p[1] <= '6') || p[1] == '8')
index 8750360c99e80ab277147e1bc99e7d8f6240e09e..4d040fb0dbc993756b72063ad92336b191238369 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1071,
 /**/
     1070,
 /**/