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

Diff for /src/usr.bin/tmux/tty-keys.c between version 1.123 and 1.124

version 1.123, 2020/04/16 13:35:24 version 1.124, 2020/04/16 15:14:25
Line 1007 
Line 1007 
 }  }
   
 /*  /*
  * Handle device attributes input. Returns 0 for success, -1 for failure, 1 for   * Handle secondary device attributes input. Returns 0 for success, -1 for
  * partial.   * failure, 1 for partial.
  */   */
 static int  static int
 tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,  tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len,
Line 1032 
Line 1032 
                 return (-1);                  return (-1);
         if (len == 2)          if (len == 2)
                 return (1);                  return (1);
         if (buf[2] != '?')          if (buf[2] != '>')
                 return (-1);                  return (-1);
         if (len == 3)          if (len == 3)
                 return (1);                  return (1);
Line 1048 
Line 1048 
         tmp[i] = '\0';          tmp[i] = '\0';
         *size = 4 + i;          *size = 4 + i;
   
         /* Convert version numbers. */          /* Convert all arguments to numbers. */
         cp = tmp;          cp = tmp;
         while ((next = strsep(&cp, ";")) != NULL) {          while ((next = strsep(&cp, ";")) != NULL) {
                 p[n] = strtoul(next, &endptr, 10);                  p[n] = strtoul(next, &endptr, 10);
Line 1059 
Line 1059 
   
         /* Set terminal flags. */          /* Set terminal flags. */
         switch (p[0]) {          switch (p[0]) {
         case 64: /* VT420 */          case 41: /* VT420 */
                 flags |= (TERM_DECFRA|TERM_DECSLRM);                  flags |= (TERM_DECFRA|TERM_DECSLRM);
                 break;                  break;
           case 'M': /* mintty */
                   flags |= (TERM_256COLOURS|TERM_RGBCOLOURS);
                   break;
           case 'T': /* tmux - if newer will have the DSR as well */
                   flags |= (TERM_UTF8|TERM_256COLOURS);
                   break;
           case 'U': /* rxvt-unicode */
                   flags |= (TERM_UTF8);
                   break;
         }          }
         for (i = 1; i < n; i++)          log_debug("%s: received secondary DA %.*s", c->name, (int)*size, buf);
                 log_debug("%s: DA feature: %d", c->name, p[i]);  
         log_debug("%s: received DA %.*s", c->name, (int)*size, buf);  
   
         tty_set_flags(tty, flags);          tty_set_flags(tty, flags);
         tty->flags |= TTY_HAVEDA;          tty->flags |= TTY_HAVEDA;
Line 1116 
Line 1123 
         *size = 3 + i;          *size = 3 + i;
   
         /* Set terminal flags. */          /* Set terminal flags. */
         if (strncmp(tmp, "ITERM2 ", 7) == 0)          if (strncmp(tmp, "ITERM2 ", 7) == 0) {
                 flags |= (TERM_DECSLRM|TERM_256COLOURS|TERM_RGBCOLOURS|TERM_SYNC);                  flags |= (TERM_UTF8|TERM_DECSLRM|TERM_SYNC|TERM_256COLOURS|
         if (strncmp(tmp, "TMUX ", 5) == 0)                      TERM_RGBCOLOURS);
                 flags |= (TERM_256COLOURS|TERM_RGBCOLOURS);          } else if (strncmp(tmp, "TMUX ", 5) == 0)
                   flags |= (TERM_UTF8|TERM_256COLOURS|TERM_RGBCOLOURS);
         log_debug("%s: received DSR %.*s", c->name, (int)*size, buf);          log_debug("%s: received DSR %.*s", c->name, (int)*size, buf);
   
         tty_set_flags(tty, flags);          tty_set_flags(tty, flags);

Legend:
Removed from v.1.123  
changed lines
  Added in v.1.124