summaryrefslogtreecommitdiffstats
path: root/cmd-join-pane.c
diff options
context:
space:
mode:
authornicm <nicm>2017-04-22 08:56:24 +0000
committernicm <nicm>2017-04-22 08:56:24 +0000
commit2c0f826c360fc5a8f0e125759b596eb28441ba65 (patch)
tree67909c9035b3986a6edd9421553be544b90513aa /cmd-join-pane.c
parentbcab77e266c37e2f1cbb74006e9b927ea4f99dfb (diff)
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.
Diffstat (limited to 'cmd-join-pane.c')
-rw-r--r--cmd-join-pane.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd-join-pane.c b/cmd-join-pane.c
index d2a50282..eb2f6022 100644
--- a/cmd-join-pane.c
+++ b/cmd-join-pane.c
@@ -63,6 +63,7 @@ static enum cmd_retval
cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
+ struct cmd_find_state *current = &item->shared->current;
struct session *dst_s;
struct winlink *src_wl, *dst_wl;
struct window *src_w, *dst_w;
@@ -146,6 +147,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
if (!args_has(args, 'd')) {
window_set_active_pane(dst_w, src_wp);
session_select(dst_s, dst_idx);
+ cmd_find_from_session(current, dst_s);
server_redraw_session(dst_s);
} else
server_status_session(dst_s);