From d7280917da5bfdf1811772c5f44fe1dd341c1742 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 6 Jun 2017 14:53:28 +0000 Subject: [PATCH 1/3] Delete input event when evbuffer_read() fails to avoid just spinning around a dead file descriptor. Seems to fix a problem reported by Greg Hurrell in GitHub issue 941. --- tty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tty.c b/tty.c index 3d0e210b..77291daa 100644 --- a/tty.c +++ b/tty.c @@ -159,8 +159,10 @@ tty_read_callback(__unused int fd, __unused short events, void *data) int nread; nread = evbuffer_read(tty->in, tty->fd, -1); - if (nread == -1) + if (nread == -1) { + event_del(&tty->event_in); return; + } log_debug("%s: read %d bytes (already %zu)", c->name, nread, size); while (tty_keys_next(tty)) From bbc35b0b19ba763c7e32185c4c12233c041b26de Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 6 Jun 2017 15:07:35 +0000 Subject: [PATCH 2/3] Do not pass a state into commands when fired on individual items in tree mode, rely on the %% target substitution in the command for the chosen pane and leave the default target as the current pane (where the mode is). Otherwise, joinp and similar end up with -t and -s the same. Reported by Jacob Niehus in GitHub issue 960. --- window-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/window-tree.c b/window-tree.c index 36a19e48..363975e3 100644 --- a/window-tree.c +++ b/window-tree.c @@ -699,7 +699,7 @@ window_tree_key(struct window_pane *wp, struct client *c, name = window_tree_get_target(item, &fs); window_pane_reset_mode(wp); if (name != NULL) - mode_tree_run_command(c, &fs, command, name); + mode_tree_run_command(c, NULL, command, name); free(name); free(command); return; From 50b27c8c0dc65cb418ed422e2cdd035a7bafedfe Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 6 Jun 2017 15:49:35 +0000 Subject: [PATCH 3/3] Continue and pass keys through if they are repeated keys, so that the first key after a repeated key doesn't get lost. --- server-client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server-client.c b/server-client.c index e8faedc7..5694a2a0 100644 --- a/server-client.c +++ b/server-client.c @@ -816,7 +816,7 @@ server_client_handle_key(struct client *c, key_code key) struct timeval tv; struct key_table *table, *first; struct key_binding bd_find, *bd; - int xtimeout; + int xtimeout, flags; struct cmd_find_state fs; /* Check the client is good to accept input. */ @@ -913,6 +913,7 @@ server_client_handle_key(struct client *c, key_code key) server_status_client(c); return; } + flags = c->flags; retry: /* Log key table. */ @@ -990,7 +991,7 @@ retry: * No match in the root table either. If this wasn't the first table * tried, don't pass the key to the pane. */ - if (first != table) { + if (first != table && (~flags & CLIENT_REPEAT)) { server_client_set_key_table(c, NULL); server_status_client(c); return;