[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.284 and 1.285

version 1.284, 2017/05/15 07:54:44 version 1.285, 2017/05/15 16:44:04
Line 71 
Line 71 
 static void     tty_default_attributes(struct tty *, const struct window_pane *,  static void     tty_default_attributes(struct tty *, const struct window_pane *,
                     u_int);                      u_int);
   
 #define tty_use_acs(tty) \  
         (tty_term_has((tty)->term, TTYC_ACSC) && !((tty)->flags & TTY_UTF8))  
 #define tty_use_margin(tty) \  #define tty_use_margin(tty) \
         ((tty)->term_type == TTY_VT420)          ((tty)->term_type == TTY_VT420)
   
Line 278 
Line 276 
 void  void
 tty_start_tty(struct tty *tty)  tty_start_tty(struct tty *tty)
 {  {
         struct termios  tio;          struct client   *c = tty->client;
           struct termios   tio;
   
         if (tty->fd != -1 && tcgetattr(tty->fd, &tty->tio) == 0) {          if (tty->fd != -1 && tcgetattr(tty->fd, &tty->tio) == 0) {
                 setblocking(tty->fd, 0);                  setblocking(tty->fd, 0);
Line 299 
Line 298 
         tty_putcode(tty, TTYC_SMCUP);          tty_putcode(tty, TTYC_SMCUP);
   
         tty_putcode(tty, TTYC_SMKX);          tty_putcode(tty, TTYC_SMKX);
         if (tty_use_acs(tty))  
                 tty_putcode(tty, TTYC_ENACS);  
         tty_putcode(tty, TTYC_CLEAR);          tty_putcode(tty, TTYC_CLEAR);
   
           if (tty_acs_needed(tty)) {
                   log_debug("%s: using capabilities for ACS", c->name);
                   tty_putcode(tty, TTYC_ENACS);
           } else
                   log_debug("%s: using UTF-8 for ACS", c->name);
   
         tty_putcode(tty, TTYC_CNORM);          tty_putcode(tty, TTYC_CNORM);
         if (tty_term_has(tty->term, TTYC_KMOUS))          if (tty_term_has(tty->term, TTYC_KMOUS))
                 tty_puts(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l");                  tty_puts(tty, "\033[?1000l\033[?1002l\033[?1006l\033[?1005l");
Line 351 
Line 354 
                 return;                  return;
   
         tty_raw(tty, tty_term_string2(tty->term, TTYC_CSR, 0, ws.ws_row - 1));          tty_raw(tty, tty_term_string2(tty->term, TTYC_CSR, 0, ws.ws_row - 1));
         if (tty_use_acs(tty))          if (tty_acs_needed(tty))
                 tty_raw(tty, tty_term_string(tty->term, TTYC_RMACS));                  tty_raw(tty, tty_term_string(tty->term, TTYC_RMACS));
         tty_raw(tty, tty_term_string(tty->term, TTYC_SGR0));          tty_raw(tty, tty_term_string(tty->term, TTYC_SGR0));
         tty_raw(tty, tty_term_string(tty->term, TTYC_RMKX));          tty_raw(tty, tty_term_string(tty->term, TTYC_RMKX));
Line 1417 
Line 1420 
         struct grid_cell        *gc = &tty->cell;          struct grid_cell        *gc = &tty->cell;
   
         if (!grid_cells_equal(gc, &grid_default_cell)) {          if (!grid_cells_equal(gc, &grid_default_cell)) {
                 if ((gc->attr & GRID_ATTR_CHARSET) && tty_use_acs(tty))                  if ((gc->attr & GRID_ATTR_CHARSET) && tty_acs_needed(tty))
                         tty_putcode(tty, TTYC_RMACS);                          tty_putcode(tty, TTYC_RMACS);
                 tty_putcode(tty, TTYC_SGR0);                  tty_putcode(tty, TTYC_SGR0);
                 memcpy(gc, &grid_default_cell, sizeof *gc);                  memcpy(gc, &grid_default_cell, sizeof *gc);
Line 1767 
Line 1770 
                 tty_putcode(tty, TTYC_INVIS);                  tty_putcode(tty, TTYC_INVIS);
         if (changed & GRID_ATTR_STRIKETHROUGH)          if (changed & GRID_ATTR_STRIKETHROUGH)
                 tty_putcode(tty, TTYC_SMXX);                  tty_putcode(tty, TTYC_SMXX);
         if ((changed & GRID_ATTR_CHARSET) && tty_use_acs(tty))          if ((changed & GRID_ATTR_CHARSET) && tty_acs_needed(tty))
                 tty_putcode(tty, TTYC_SMACS);                  tty_putcode(tty, TTYC_SMACS);
 }  }
   

Legend:
Removed from v.1.284  
changed lines
  Added in v.1.285