summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2017-04-20 15:16:21 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2017-04-20 15:16:21 +0000
commit8e24143715a3a3d9357dfb5e0c6a3b3f9c6bc04d (patch)
tree3a1ca86fdb12d6708ef218900f1f51829a75ebb3 /usr.bin/tmux
parent06744ebe3179b7a5d19d1e18969ee119d60aed78 (diff)
Only set up a current target for mouse key bindings. Fixes:
bind q select-pane -U \; resize-pane -Z (There is still some possible weirdness with the way we do current targets, it should probably be done in a different way at some point.)
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/server-client.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c
index a88c065e527..9fcf8d01fcc 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.220 2017/04/19 14:00:28 nicm Exp $ */
+/* $OpenBSD: server-client.c,v 1.221 2017/04/20 15:16:20 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -940,8 +940,8 @@ retry:
server_status_client(c);
/* Find default state if the pane is known. */
- cmd_find_clear_state(&fs, NULL, 0);
- if (wp != NULL) {
+ if (KEYC_IS_MOUSE(key) && m->valid && wp != NULL) {
+ cmd_find_clear_state(&fs, NULL, 0);
fs.s = s;
fs.wl = fs.s->curw;
fs.w = fs.wl->window;
@@ -950,10 +950,9 @@ retry:
if (!cmd_find_valid_state(&fs))
fatalx("invalid key state");
- }
-
- /* Dispatch the key binding. */
- key_bindings_dispatch(bd, c, m, &fs);
+ key_bindings_dispatch(bd, c, m, &fs);
+ } else
+ key_bindings_dispatch(bd, c, m, NULL);
key_bindings_unref_table(table);
return;
}