fix(tui): wrong default input key encoding (#36440)

Don't override the default key encoding in tinput_init(), now that it's
called after terminfo_start().
This commit is contained in:
zeertzjq
2025-11-03 14:23:45 +08:00
committed by GitHub
parent 130ef73e39
commit b80d390765
2 changed files with 5 additions and 2 deletions

View File

@@ -129,7 +129,6 @@ void tinput_init(TermInput *input, Loop *loop, TerminfoEntry *ti)
input->loop = loop;
input->paste = 0;
input->in_fd = STDIN_FILENO;
input->key_encoding = kKeyEncodingLegacy;
input->ttimeout = (bool)p_ttimeout;
input->ttimeoutlen = p_ttm;

View File

@@ -2391,7 +2391,11 @@ static void augment_terminfo(TUIData *tui, const char *term, int vte_version, in
tui_enable_extended_underline(tui);
}
if (!kitty && (vte_version == 0 || vte_version >= 5400)) {
if (kitty || (vte_version != 0 && vte_version < 5400)) {
// Never use modifyOtherKeys in kitty if kitty keyboard protocol query fails.
// Also don't emit the sequence to enable modifyOtherKeys in old VTE versions.
tui->input.key_encoding = kKeyEncodingLegacy;
} else {
// Fallback to Xterm's modifyOtherKeys if terminal does not support the
// Kitty keyboard protocol. We don't actually enable the key encoding here
// though: it won't be enabled until the terminal responds to our query for