=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/tty-keys.c,v retrieving revision 1.123 retrieving revision 1.124 diff -c -r1.123 -r1.124 *** src/usr.bin/tmux/tty-keys.c 2020/04/16 13:35:24 1.123 --- src/usr.bin/tmux/tty-keys.c 2020/04/16 15:14:25 1.124 *************** *** 1,4 **** ! /* $OpenBSD: tty-keys.c,v 1.123 2020/04/16 13:35:24 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: tty-keys.c,v 1.124 2020/04/16 15:14:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 1007,1014 **** } /* ! * Handle device attributes input. Returns 0 for success, -1 for failure, 1 for ! * partial. */ static int tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len, --- 1007,1014 ---- } /* ! * Handle secondary device attributes input. Returns 0 for success, -1 for ! * failure, 1 for partial. */ static int tty_keys_device_attributes(struct tty *tty, const char *buf, size_t len, *************** *** 1032,1038 **** return (-1); if (len == 2) return (1); ! if (buf[2] != '?') return (-1); if (len == 3) return (1); --- 1032,1038 ---- return (-1); if (len == 2) return (1); ! if (buf[2] != '>') return (-1); if (len == 3) return (1); *************** *** 1048,1054 **** tmp[i] = '\0'; *size = 4 + i; ! /* Convert version numbers. */ cp = tmp; while ((next = strsep(&cp, ";")) != NULL) { p[n] = strtoul(next, &endptr, 10); --- 1048,1054 ---- tmp[i] = '\0'; *size = 4 + i; ! /* Convert all arguments to numbers. */ cp = tmp; while ((next = strsep(&cp, ";")) != NULL) { p[n] = strtoul(next, &endptr, 10); *************** *** 1059,1071 **** /* Set terminal flags. */ switch (p[0]) { ! case 64: /* VT420 */ flags |= (TERM_DECFRA|TERM_DECSLRM); break; } ! for (i = 1; i < n; i++) ! 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->flags |= TTY_HAVEDA; --- 1059,1078 ---- /* Set terminal flags. */ switch (p[0]) { ! case 41: /* VT420 */ flags |= (TERM_DECFRA|TERM_DECSLRM); 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; } ! log_debug("%s: received secondary DA %.*s", c->name, (int)*size, buf); tty_set_flags(tty, flags); tty->flags |= TTY_HAVEDA; *************** *** 1116,1125 **** *size = 3 + i; /* Set terminal flags. */ ! if (strncmp(tmp, "ITERM2 ", 7) == 0) ! flags |= (TERM_DECSLRM|TERM_256COLOURS|TERM_RGBCOLOURS|TERM_SYNC); ! if (strncmp(tmp, "TMUX ", 5) == 0) ! flags |= (TERM_256COLOURS|TERM_RGBCOLOURS); log_debug("%s: received DSR %.*s", c->name, (int)*size, buf); tty_set_flags(tty, flags); --- 1123,1133 ---- *size = 3 + i; /* Set terminal flags. */ ! if (strncmp(tmp, "ITERM2 ", 7) == 0) { ! flags |= (TERM_UTF8|TERM_DECSLRM|TERM_SYNC|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); tty_set_flags(tty, flags);