=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/input.c,v retrieving revision 1.174.4.1 retrieving revision 1.175 diff -c -r1.174.4.1 -r1.175 *** src/usr.bin/tmux/input.c 2020/10/29 16:34:15 1.174.4.1 --- src/usr.bin/tmux/input.c 2020/05/16 14:16:25 1.175 *************** *** 1,4 **** ! /* $OpenBSD: input.c,v 1.174.4.1 2020/10/29 16:34:15 deraadt Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: input.c,v 1.175 2020/05/16 14:16:25 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott *************** *** 254,259 **** --- 254,260 ---- INPUT_CSI_TBC, INPUT_CSI_VPA, INPUT_CSI_WINOPS, + INPUT_CSI_XDA, }; /* Control (CSI) command table. */ *************** *** 290,295 **** --- 291,297 ---- { 'm', "", INPUT_CSI_SGR }, { 'n', "", INPUT_CSI_DSR }, { 'q', " ", INPUT_CSI_DECSCUSR }, + { 'q', ">", INPUT_CSI_XDA }, { 'r', "", INPUT_CSI_DECSTBM }, { 's', "", INPUT_CSI_SCP }, { 't', "", INPUT_CSI_WINOPS }, *************** *** 1324,1330 **** struct input_table_entry *entry; int i, n, m; u_int cx, bg = ictx->cell.cell.bg; - char *copy, *cp; if (ictx->flags & INPUT_DISCARD) return (0); --- 1326,1331 ---- *************** *** 1456,1468 **** case 6: input_reply(ictx, "\033[%u;%uR", s->cy + 1, s->cx + 1); break; - case 1337: /* Terminal version, from iTerm2. */ - copy = xstrdup(getversion()); - for (cp = copy; *cp != '\0'; cp++) - *cp = toupper((u_char)*cp); - input_reply(ictx, "\033[TMUX %sn", copy); - free(copy); - break; default: log_debug("%s: unknown '%c'", __func__, ictx->ch); break; --- 1457,1462 ---- *************** *** 1597,1602 **** --- 1591,1602 ---- if (n != -1) screen_set_cursor_style(s, n); break; + case INPUT_CSI_XDA: + n = input_get(ictx, 0, 0, 0); + if (n != 0) + input_reply(ictx, "\033P>|tmux %s\033\\", getversion()); + break; + } ictx->last = -1; *************** *** 1968,1980 **** free(copy); return; } ! } else { n++; - if (n == nitems(p)) { - free(copy); - return; - } - } log_debug("%s: %u = %d", __func__, n - 1, p[n - 1]); } free(copy); --- 1968,1975 ---- free(copy); return; } ! } else n++; log_debug("%s: %u = %d", __func__, n - 1, p[n - 1]); } free(copy);