summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-split-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2017-04-22 08:56:24 +0000
committernicm <nicm@openbsd.org>2017-04-22 08:56:24 +0000
commit0e2c9d0f0effc1d2ee144f302bcdacd2fbafa082 (patch)
tree389cb0062e095c32de617b06be251304a93eeee5 /usr.bin/tmux/cmd-split-window.c
parentWe need to collect UTF-8 characters so that width != 1 characters are (diff)
downloadwireguard-openbsd-0e2c9d0f0effc1d2ee144f302bcdacd2fbafa082.tar.xz
wireguard-openbsd-0e2c9d0f0effc1d2ee144f302bcdacd2fbafa082.zip
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 'usr.bin/tmux/cmd-split-window.c')
-rw-r--r--usr.bin/tmux/cmd-split-window.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-split-window.c b/usr.bin/tmux/cmd-split-window.c
index 94bd1b676e7..9a963db3b80 100644
--- a/usr.bin/tmux/cmd-split-window.c
+++ b/usr.bin/tmux/cmd-split-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-split-window.c,v 1.81 2017/04/21 17:22:20 nicm Exp $ */
+/* $OpenBSD: cmd-split-window.c,v 1.82 2017/04/22 08:56:24 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -53,6 +53,7 @@ const struct cmd_entry cmd_split_window_entry = {
static enum cmd_retval
cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
{
+ struct cmd_find_state *current = &item->shared->current;
struct args *args = self->args;
struct client *c = item->state.c;
struct session *s = item->state.tflag.s;
@@ -156,6 +157,7 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
if (!args_has(args, 'd')) {
window_set_active_pane(w, new_wp);
session_select(s, wl->idx);
+ cmd_find_from_session(current, s);
server_redraw_session(s);
} else
server_status_session(s);