diff options
author | nicm <nicm> | 2020-01-13 07:51:54 +0000 |
---|---|---|
committer | nicm <nicm> | 2020-01-13 07:51:54 +0000 |
commit | 04eee2410df4a85005c9562db13a1fec93d7c2e4 (patch) | |
tree | 056d63f2e4f7d0b364fd69d3c3e821164dd2c6a8 /window.c | |
parent | 381333c4a9fd521bee8a0287e648f0c6aeb96a0b (diff) | |
download | rtmux-04eee2410df4a85005c9562db13a1fec93d7c2e4.tar.gz rtmux-04eee2410df4a85005c9562db13a1fec93d7c2e4.tar.bz2 rtmux-04eee2410df4a85005c9562db13a1fec93d7c2e4.zip |
Treat plausible but invalid keys (like C-BSpace) as literal like any
other unrecognised string passed to send-keys. Reported by Anthony
Sottile in GitHub issue 2049.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -1229,7 +1229,7 @@ window_pane_reset_mode_all(struct window_pane *wp) window_pane_reset_mode(wp); } -void +int window_pane_key(struct window_pane *wp, struct client *c, struct session *s, struct winlink *wl, key_code key, struct mouse_event *m) { @@ -1237,23 +1237,24 @@ window_pane_key(struct window_pane *wp, struct client *c, struct session *s, struct window_pane *wp2; if (KEYC_IS_MOUSE(key) && m == NULL) - return; + return (-1); wme = TAILQ_FIRST(&wp->modes); if (wme != NULL) { wp->modelast = time(NULL); if (wme->mode->key != NULL) wme->mode->key(wme, c, s, wl, (key & ~KEYC_XTERM), m); - return; + return (0); } if (wp->fd == -1 || wp->flags & PANE_INPUTOFF) - return; + return (0); - input_key(wp, key, m); + if (input_key(wp, key, m) != 0) + return (-1); if (KEYC_IS_MOUSE(key)) - return; + return (0); if (options_get_number(wp->window->options, "synchronize-panes")) { TAILQ_FOREACH(wp2, &wp->window->panes, entry) { if (wp2 != wp && @@ -1264,6 +1265,7 @@ window_pane_key(struct window_pane *wp, struct client *c, struct session *s, input_key(wp2, key, NULL); } } + return (0); } int |