Skip to content

Commit a0a6f27

Browse files
committed
patch 8.0.1174: Mac Terminal.app has wrong color for white
Problem: Mac Terminal.app has wrong color for white. Solution: Use white from the color cube.
1 parent 19a3d68 commit a0a6f27

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/globals.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ EXTERN int cterm_normal_bg_color INIT(= 0);
380380
EXTERN guicolor_T cterm_normal_fg_gui_color INIT(= INVALCOLOR);
381381
EXTERN guicolor_T cterm_normal_bg_gui_color INIT(= INVALCOLOR);
382382
#endif
383+
#ifdef FEAT_TERMRESPONSE
384+
EXTERN int is_mac_terminal INIT(= FALSE); /* recognized Terminal.app */
385+
#endif
383386

384387
#ifdef FEAT_AUTOCMD
385388
EXTERN int autocmd_busy INIT(= FALSE); /* Is apply_autocmds() busy? */

src/syntax.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7350,6 +7350,10 @@ lookup_color(int idx, int foreground, int *boldp)
73507350
else
73517351
color = color_numbers_8[idx];
73527352
}
7353+
if (t_colors >= 256 && color == 15 && is_mac_terminal)
7354+
/* Terminal.app has a bug: 15 is light grey. Use white
7355+
* from the color cube instead. */
7356+
color = 231;
73537357
}
73547358
return color;
73557359
}

src/term.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4557,7 +4557,10 @@ check_termcode(
45574557
/* Mac Terminal.app sends 1;95;0 */
45584558
if (version == 95
45594559
&& STRNCMP(tp + extra - 2, "1;95;0c", 7) == 0)
4560+
{
45604561
is_not_xterm = TRUE;
4562+
is_mac_terminal = TRUE;
4563+
}
45614564

45624565
/* Gnome terminal sends 1;3801;0, 1;4402;0 or 1;2501;0.
45634566
* xfce4-terminal sends 1;2802;0.

src/version.c

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

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1174,
764766
/**/
765767
1173,
766768
/**/

0 commit comments

Comments
 (0)