Add Kitty keyboard protocol support

This commit is contained in:
Michael Grant
2026-09-14 14:14:28 +01:00
parent 3a5df8780f
commit 5e5cc3e5bc
17 changed files with 1256 additions and 25 deletions

View File

@@ -2033,7 +2033,8 @@ window_pane_copy_paste(struct window_pane *wp, char *buf, size_t len)
}
static void
window_pane_copy_key(struct window_pane *wp, key_code key)
window_pane_copy_key(struct window_pane *wp, key_code key,
int extended_encoding)
{
struct window_pane *loop;
@@ -2044,7 +2045,7 @@ window_pane_copy_key(struct window_pane *wp, key_code key)
(~loop->flags & PANE_INPUTOFF) &&
window_pane_is_visible(loop) &&
options_get_number(loop->options, "synchronize-panes"))
input_key_pane(loop, key, NULL);
input_key_pane(loop, key, NULL, extended_encoding);
}
}
@@ -2072,6 +2073,7 @@ window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
struct winlink *wl, key_code key, struct mouse_event *m)
{
struct window_mode_entry *wme;
int extended_encoding;
if (KEYC_IS_MOUSE(key) && m == NULL)
return (-1);
@@ -2094,13 +2096,14 @@ window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
if (wp->fd == -1 || wp->flags & PANE_INPUTOFF)
return (0);
if (input_key_pane(wp, key, m) != 0)
extended_encoding = input_key_client_supports_extended(c, key);
if (input_key_pane(wp, key, m, extended_encoding) != 0)
return (-1);
if (KEYC_IS_MOUSE(key))
return (0);
if (options_get_number(wp->options, "synchronize-panes"))
window_pane_copy_key(wp, key);
window_pane_copy_key(wp, key, extended_encoding);
return (0);
}