]> granicus.if.org Git - vim/commitdiff
patch 8.0.1174: Mac Terminal.app has wrong color for white v8.0.1174
authorBram Moolenaar <Bram@vim.org>
Wed, 4 Oct 2017 16:04:16 +0000 (18:04 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 4 Oct 2017 16:04:16 +0000 (18:04 +0200)
Problem:    Mac Terminal.app has wrong color for white.
Solution:   Use white from the color cube.

src/globals.h
src/syntax.c
src/term.c
src/version.c

index 71d3433f59ffee9b669b9455155ba78bb38adee4..c9e6d6cd67a18e67daf462aab2f5919381d91a82 100644 (file)
@@ -380,6 +380,9 @@ EXTERN int  cterm_normal_bg_color INIT(= 0);
 EXTERN guicolor_T cterm_normal_fg_gui_color INIT(= INVALCOLOR);
 EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR);
 #endif
+#ifdef FEAT_TERMRESPONSE
+EXTERN int     is_mac_terminal INIT(= FALSE);  /* recognized Terminal.app */
+#endif
 
 #ifdef FEAT_AUTOCMD
 EXTERN int     autocmd_busy INIT(= FALSE);     /* Is apply_autocmds() busy? */
index 534d2d21df9d730a7ba559b0235277f18dd1662b..d7c482d5439e6230c81e2b14dcac2f4051dd5c2f 100644 (file)
@@ -7350,6 +7350,10 @@ lookup_color(int idx, int foreground, int *boldp)
            else
                color = color_numbers_8[idx];
        }
+       if (t_colors >= 256 && color == 15 && is_mac_terminal)
+           /* Terminal.app has a bug: 15 is light grey. Use white
+            * from the color cube instead. */
+           color = 231;
     }
     return color;
 }
index 07292bca2e635fb4d7d293ae3fe6055fc3655d83..9925b0afa878f283041187cba8286e4e2ad21eda 100644 (file)
@@ -4557,7 +4557,10 @@ check_termcode(
                        /* Mac Terminal.app sends 1;95;0 */
                        if (version == 95
                                && STRNCMP(tp + extra - 2, "1;95;0c", 7) == 0)
+                       {
                            is_not_xterm = TRUE;
+                           is_mac_terminal = TRUE;
+                       }
 
                        /* Gnome terminal sends 1;3801;0, 1;4402;0 or 1;2501;0.
                         * xfce4-terminal sends 1;2802;0.
index ab0d57d4013cb7412926c5bc245b47b01f897646..1d212777a15fae683293f6db2dd370fdb0519748 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1174,
 /**/
     1173,
 /**/