mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
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:
20
format.c
20
format.c
@ -1962,6 +1962,23 @@ format_cb_pane_unseen_changes(struct format_tree *ft)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_key_mode. */
|
||||
static void *
|
||||
format_cb_pane_key_mode(struct format_tree *ft)
|
||||
{
|
||||
if (ft->wp != NULL && ft->wp->screen != NULL) {
|
||||
switch (ft->wp->screen->mode & EXTENDED_KEY_MODES) {
|
||||
case MODE_KEYS_EXTENDED:
|
||||
return (xstrdup("Ext 1"));
|
||||
case MODE_KEYS_EXTENDED_2:
|
||||
return (xstrdup("Ext 2"));
|
||||
default:
|
||||
return (xstrdup("VT10x"));
|
||||
}
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* Callback for pane_last. */
|
||||
static void *
|
||||
format_cb_pane_last(struct format_tree *ft)
|
||||
@ -2997,6 +3014,9 @@ static const struct format_table_entry format_table[] = {
|
||||
{ "pane_input_off", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_input_off
|
||||
},
|
||||
{ "pane_key_mode", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_key_mode
|
||||
},
|
||||
{ "pane_last", FORMAT_TABLE_STRING,
|
||||
format_cb_pane_last
|
||||
},
|
||||
|
Reference in New Issue
Block a user