changeset 12383:1890536614ea v8.0.1071

patch 8.0.1071: putty-color and cygwin-color are not recognized commit https://github.com/vim/vim/commit/c6da01a5b8efe9ca4931074c0cf2189d357707a2 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Sep 7 22:37:36 2017 +0200 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)
author Christian Brabandt <cb@256bit.org>
date Thu, 07 Sep 2017 22:45:04 +0200
parents 4a9568a1ea5f
children a9cf1e51c795
files src/option.c src/version.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/option.c
+++ b/src/option.c
@@ -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')
--- a/src/version.c
+++ b/src/version.c
@@ -770,6 +770,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1071,
+/**/
     1070,
 /**/
     1069,