=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/server-client.c,v retrieving revision 1.200 retrieving revision 1.201 diff -c -r1.200 -r1.201 *** src/usr.bin/tmux/server-client.c 2016/11/16 11:37:16 1.200 --- src/usr.bin/tmux/server-client.c 2016/11/23 17:01:24 1.201 *************** *** 1,4 **** ! /* $OpenBSD: server-client.c,v 1.200 2016/11/16 11:37:16 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott --- 1,4 ---- ! /* $OpenBSD: server-client.c,v 1.201 2016/11/23 17:01:24 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott *************** *** 692,697 **** --- 692,698 ---- 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,811 **** } server_status_client(c); /* Dispatch the key binding. */ ! key_bindings_dispatch(bd, c, m); key_bindings_unref_table(table); return; } --- 805,825 ---- } 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, &fs); key_bindings_unref_table(table); return; }