fix(tui): update modifyOtherKeys reporting

* Use the Eneks and Dseks terminfo attributes if they exist
* Add VTE versions below 0.54.0 to the blacklist

(cherry picked from commit 56a1a7ca16)
This commit is contained in:
Gregory Anders
2022-04-17 21:33:19 -06:00
committed by github-actions[bot]
parent 555ded8e82
commit 0f811afc96

View File

@@ -311,8 +311,7 @@ static void terminfo_start(UI *ui)
// Enable bracketed paste // Enable bracketed paste
unibi_out_ext(ui, data->unibi_ext.enable_bracketed_paste); unibi_out_ext(ui, data->unibi_ext.enable_bracketed_paste);
// Enable extended keys (also known as 'modifyOtherKeys' or CSI u). On terminals that don't // Enable extended keys (also known as 'modifyOtherKeys' or CSI u)
// support this, this sequence is ignored.
unibi_out_ext(ui, data->unibi_ext.enable_extended_keys); unibi_out_ext(ui, data->unibi_ext.enable_extended_keys);
int ret; int ret;
@@ -2075,13 +2074,15 @@ static void augment_terminfo(TUIData *data, const char *term, long vte_version,
"\x1b[58:2::%p1%d:%p2%d:%p3%dm"); "\x1b[58:2::%p1%d:%p2%d:%p3%dm");
} }
if (!kitty) { data->unibi_ext.enable_extended_keys = unibi_find_ext_str(ut, "Eneks");
// Kitty does not support these sequences; it only supports it's own CSI > 1 u which enables the data->unibi_ext.disable_extended_keys = unibi_find_ext_str(ut, "Dseks");
// Kitty keyboard protocol if (data->unibi_ext.enable_extended_keys == -1) {
data->unibi_ext.enable_extended_keys = (int)unibi_add_ext_str(ut, "ext.enable_extended_keys", if (!kitty && (vte_version == 0 || vte_version >= 5400)) {
"\x1b[>4;2m"); data->unibi_ext.enable_extended_keys = (int)unibi_add_ext_str(ut, "ext.enable_extended_keys",
data->unibi_ext.disable_extended_keys = (int)unibi_add_ext_str(ut, "ext.disable_extended_keys", "\x1b[>4;2m");
"\x1b[>4;0m"); data->unibi_ext.disable_extended_keys = (int)unibi_add_ext_str(ut, "ext.disable_extended_keys",
"\x1b[>4m");
}
} }
} }