summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-11-23 17:01:24 +0000
committernicm <nicm@openbsd.org>2016-11-23 17:01:24 +0000
commit6123866d41f42840bf427c37e322d258296558c1 (patch)
tree1c49b02c626910228f53852835e5562769eff133 /usr.bin/tmux/server-client.c
parentError on invalid modifier keys. (diff)
downloadwireguard-openbsd-6123866d41f42840bf427c37e322d258296558c1.tar.xz
wireguard-openbsd-6123866d41f42840bf427c37e322d258296558c1.zip
For mouse keys, use the mouse pane as the default current pane.
Diffstat (limited to 'usr.bin/tmux/server-client.c')
-rw-r--r--usr.bin/tmux/server-client.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index 81ba5012992..f2be6e1ffba 100644
--- a/usr.bin/tmux/server-client.c
+++ b/usr.bin/tmux/server-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-client.c,v 1.200 2016/11/16 11:37:16 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.201 2016/11/23 17:01:24 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -692,6 +692,7 @@ server_client_handle_key(struct client *c, key_code key)
struct key_table *table;
struct key_binding bd_find, *bd;
int xtimeout;
+ struct cmd_find_state fs;
/* Check the client is good to accept input. */
if (s == NULL || (c->flags & (CLIENT_DEAD|CLIENT_SUSPENDED)) != 0)
@@ -804,8 +805,21 @@ retry:
}
server_status_client(c);
+ /* Find default state if the pane is known. */
+ cmd_find_clear_state(&fs, NULL, 0);
+ if (wp != NULL) {
+ fs.s = s;
+ fs.wl = fs.s->curw;
+ fs.w = fs.wl->window;
+ fs.wp = wp;
+ cmd_find_log_state(__func__, &fs);
+
+ if (!cmd_find_valid_state(&fs))
+ fatalx("invalid key state");
+ }
+
/* Dispatch the key binding. */
- key_bindings_dispatch(bd, c, m);
+ key_bindings_dispatch(bd, c, m, &fs);
key_bindings_unref_table(table);
return;
}