[BACK]Return to tty.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / tmux

Diff for /src/usr.bin/tmux/tty.c between version 1.218 and 1.219

version 1.218, 2016/12/07 09:16:55 version 1.219, 2017/01/07 15:28:13
Line 48 
Line 48 
                     u_int);                      u_int);
   
 static void     tty_colours(struct tty *, const struct grid_cell *);  static void     tty_colours(struct tty *, const struct grid_cell *);
 static void     tty_check_fg(struct tty *, struct grid_cell *);  static void     tty_check_fg(struct tty *, const struct window_pane *,
 static void     tty_check_bg(struct tty *, struct grid_cell *);                      struct grid_cell *);
   static void     tty_check_bg(struct tty *, const struct window_pane *,
                       struct grid_cell *);
 static void     tty_colours_fg(struct tty *, const struct grid_cell *);  static void     tty_colours_fg(struct tty *, const struct grid_cell *);
 static void     tty_colours_bg(struct tty *, const struct grid_cell *);  static void     tty_colours_bg(struct tty *, const struct grid_cell *);
   
Line 1507 
Line 1509 
         }          }
   
         /* Fix up the colours if necessary. */          /* Fix up the colours if necessary. */
         tty_check_fg(tty, &gc2);          tty_check_fg(tty, wp, &gc2);
         tty_check_bg(tty, &gc2);          tty_check_bg(tty, wp, &gc2);
   
         /* If any bits are being cleared, reset everything. */          /* If any bits are being cleared, reset everything. */
         if (tc->attr & ~gc2.attr)          if (tc->attr & ~gc2.attr)
Line 1604 
Line 1606 
                 tty_colours_bg(tty, gc);                  tty_colours_bg(tty, gc);
 }  }
   
 void  static void
 tty_check_fg(struct tty *tty, struct grid_cell *gc)  tty_check_fg(struct tty *tty, const struct window_pane *wp,
       struct grid_cell *gc)
 {  {
         u_char  r, g, b;          u_char  r, g, b;
         u_int   colours;          u_int   colours;
   
           /* Perform substitution if this pane has a palette */
           if ((~gc->flags & GRID_FLAG_NOPALETTE) &&
               gc->fg != 8 && WINDOW_PANE_PALETTE_HAS(wp, gc->fg))
                   gc->fg = wp->palette[gc->fg & 0xff];
   
         /* Is this a 24-bit colour? */          /* Is this a 24-bit colour? */
         if (gc->fg & COLOUR_FLAG_RGB) {          if (gc->fg & COLOUR_FLAG_RGB) {
                 /* Not a 24-bit terminal? Translate to 256-colour palette. */                  /* Not a 24-bit terminal? Translate to 256-colour palette. */
Line 1646 
Line 1654 
         }          }
 }  }
   
 void  static void
 tty_check_bg(struct tty *tty, struct grid_cell *gc)  tty_check_bg(struct tty *tty, const struct window_pane *wp,
       struct grid_cell *gc)
 {  {
         u_char  r, g, b;          u_char  r, g, b;
         u_int   colours;          u_int   colours;
   
           /* Perform substitution if this pane has a palette */
           if ((~gc->flags & GRID_FLAG_NOPALETTE) &&
               gc->bg != 8 && WINDOW_PANE_PALETTE_HAS(wp, gc->bg))
                   gc->bg = wp->palette[gc->bg & 0xff];
   
         /* Is this a 24-bit colour? */          /* Is this a 24-bit colour? */
         if (gc->bg & COLOUR_FLAG_RGB) {          if (gc->bg & COLOUR_FLAG_RGB) {
                 /* Not a 24-bit terminal? Translate to 256-colour palette. */                  /* Not a 24-bit terminal? Translate to 256-colour palette. */
Line 1826 
Line 1840 
                         gc->fg = agc->fg;                          gc->fg = agc->fg;
                 else                  else
                         gc->fg = wgc->fg;                          gc->fg = wgc->fg;
   
                   if (gc->fg != 8 && WINDOW_PANE_PALETTE_HAS(wp, gc->fg))
                           gc->fg = wp->palette[gc->fg & 0xff];
         }          }
   
         if (gc->bg == 8) {          if (gc->bg == 8) {
Line 1835 
Line 1852 
                         gc->bg = agc->bg;                          gc->bg = agc->bg;
                 else                  else
                         gc->bg = wgc->bg;                          gc->bg = wgc->bg;
   
                   if (gc->bg != 8 && WINDOW_PANE_PALETTE_HAS(wp, gc->bg))
                           gc->bg = wp->palette[gc->bg & 0xff];
         }          }
 }  }
   

Legend:
Removed from v.1.218  
changed lines
  Added in v.1.219