diff options
author | 2016-10-13 10:01:49 +0000 | |
---|---|---|
committer | 2016-10-13 10:01:49 +0000 | |
commit | 788e192f1e52e7b4e4b046f4a21806c22cce079d (patch) | |
tree | 2f49c218475facd9ed503941a8f0f51626a9eac9 /usr.bin/tmux/cmd-join-pane.c | |
parent | -f missed from splitw usage, from Felix Rosencrantz. (diff) | |
download | wireguard-openbsd-788e192f1e52e7b4e4b046f4a21806c22cce079d.tar.xz wireguard-openbsd-788e192f1e52e7b4e4b046f4a21806c22cce079d.zip |
Some improvements and bug fixes for hooks:
- Prepare the state again before the "after" hooks are run, because the
command may have killed or moved windows.
- Use the hooks list from the newly prepared target, not the old hooks
list (only matters for new-session really).
- Correctly detect an invalid current state and ignore it in
cmd_find_target ("killw; swapw").
- Change neww, new, killp, killw, splitw, swapp, swapw to update the
current state (used if no explicit target is given) to something more
useful after they have finished. For example, neww changes it to the
newly created window.
Hooks are still relatively new and primitive so there are likely to be
more changes to come.
Parts based on bug reports from Uwe Werler and Iblis Lin.
Diffstat (limited to 'usr.bin/tmux/cmd-join-pane.c')
-rw-r--r-- | usr.bin/tmux/cmd-join-pane.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-join-pane.c b/usr.bin/tmux/cmd-join-pane.c index b32d75e1a3d..30ff89dcb82 100644 --- a/usr.bin/tmux/cmd-join-pane.c +++ b/usr.bin/tmux/cmd-join-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-join-pane.c,v 1.26 2016/10/10 21:51:39 nicm Exp $ */ +/* $OpenBSD: cmd-join-pane.c,v 1.27 2016/10/13 10:01:49 nicm Exp $ */ /* * Copyright (c) 2011 George Nachman <tmux@georgester.com> @@ -156,5 +156,12 @@ cmd_join_pane_exec(struct cmd *self, struct cmd_q *cmdq) notify_window_layout_changed(src_w); notify_window_layout_changed(dst_w); + cmd_find_clear_state(&cmdq->current, NULL, 0); + cmdq->current.s = dst_s; + cmdq->current.wl = dst_wl; + cmdq->current.w = dst_w; + cmdq->current.wp = dst_wp; + cmd_find_log_state(__func__, &cmdq->current); + return (CMD_RETURN_NORMAL); } |