Revamp extended keys support to more closely match xterm and support

mode 2 as well as mode 1. From Stanislav Kljuhhin (GitHub issue 4038).

This changes tmux to always request mode 2 from parent terminal, change
to an unambiguous internal representation of keys, and adds an option
(extended-keys-format) to control the format similar to the xterm(1)
formatOtherKeys resource.
This commit is contained in:
nicm
2024-08-21 04:17:09 +00:00
parent de6bce057a
commit c7e61a01e5
12 changed files with 238 additions and 136 deletions

8
menu.c
View File

@ -335,7 +335,7 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
c->flags |= CLIENT_REDRAWOVERLAY;
return (0);
case KEYC_PPAGE:
case '\002': /* C-b */
case 'b'|KEYC_CTRL:
if (md->choice < 6)
md->choice = 0;
else {
@ -394,13 +394,13 @@ menu_key_cb(struct client *c, void *data, struct key_event *event)
}
c->flags |= CLIENT_REDRAWOVERLAY;
break;
case '\006': /* C-f */
case 'f'|KEYC_CTRL:
break;
case '\r':
goto chosen;
case '\033': /* Escape */
case '\003': /* C-c */
case '\007': /* C-g */
case 'c'|KEYC_CTRL:
case 'g'|KEYC_CTRL:
case 'q':
return (1);
}