From 2c0f826c360fc5a8f0e125759b596eb28441ba65 Mon Sep 17 00:00:00 2001 From: nicm Date: Sat, 22 Apr 2017 08:56:24 +0000 Subject: Mouse bindings and hooks set up an initial current state when running a command. This is used for the session, window and pane for all commands in the command sequence if there is no -t or -s. However, using it for all commands in the command sequence means that if the active pane or current session is changed, subsequent commands still use the previous state. So make commands which explicitly change the current state (such as neww and selectp) update it themselves for later commands. Commands which may invalidate the state (like killp) are already OK because an invalid state will be ignored. Also fill in the current state for all key bindings rather than just the mouse, so that any omissions are easier to spot. --- cmd-switch-client.c | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd-switch-client.c') diff --git a/cmd-switch-client.c b/cmd-switch-client.c index 06388d44..dbb57ff0 100644 --- a/cmd-switch-client.c +++ b/cmd-switch-client.c @@ -99,6 +99,7 @@ cmd_switch_client_exec(struct cmd *self, struct cmdq_item *item) if (wp != NULL) window_set_active_pane(wp->window, wp); session_set_current(s, state->tflag.wl); + cmd_find_from_session(&item->shared->current, s); } } -- cgit v1.2.3