aboutsummaryrefslogtreecommitdiff
path: root/cmd-move-window.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2015-06-17 20:01:12 +0100
committerThomas Adam <thomas@xteddy.org>2015-06-17 20:01:12 +0100
commit21a2ccc5f16be454ed7a2fd47e65a51d5faa4597 (patch)
tree8e58252b5da492a2e4e0ed5fdc35e098ca05bfc1 /cmd-move-window.c
parenta584e11d6bb5d2ab0e0476f6c1a821e865597053 (diff)
parent84f0622c852761a2d6688e944bc01a03af78c52a (diff)
downloadrtmux-21a2ccc5f16be454ed7a2fd47e65a51d5faa4597.tar.gz
rtmux-21a2ccc5f16be454ed7a2fd47e65a51d5faa4597.tar.bz2
rtmux-21a2ccc5f16be454ed7a2fd47e65a51d5faa4597.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-move-window.c')
-rw-r--r--cmd-move-window.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/cmd-move-window.c b/cmd-move-window.c
index e765b625..b15df4f6 100644
--- a/cmd-move-window.c
+++ b/cmd-move-window.c
@@ -30,7 +30,7 @@ enum cmd_retval cmd_move_window_exec(struct cmd *, struct cmd_q *);
const struct cmd_entry cmd_move_window_entry = {
"move-window", "movew",
- "dkrs:t:", 0, 0,
+ "adkrs:t:", 0, 0,
"[-dkr] " CMD_SRCDST_WINDOW_USAGE,
0,
cmd_move_window_exec
@@ -38,7 +38,7 @@ const struct cmd_entry cmd_move_window_entry = {
const struct cmd_entry cmd_link_window_entry = {
"link-window", "linkw",
- "dks:t:", 0, 0,
+ "adks:t:", 0, 0,
"[-dk] " CMD_SRCDST_WINDOW_USAGE,
0,
cmd_move_window_exec
@@ -72,6 +72,15 @@ cmd_move_window_exec(struct cmd *self, struct cmd_q *cmdq)
kflag = args_has(self->args, 'k');
dflag = args_has(self->args, 'd');
sflag = args_has(self->args, 's');
+
+ if (args_has(self->args, 'a')) {
+ s = cmd_find_session(cmdq, args_get(args, 't'), 0);
+ if (s == NULL)
+ return (CMD_RETURN_ERROR);
+ if ((idx = winlink_shuffle_up(s, s->curw)) == -1)
+ return (CMD_RETURN_ERROR);
+ }
+
if (server_link_window(src, wl, dst, idx, kflag, !dflag,
&cause) != 0) {
cmdq_error(cmdq, "can't link window: %s", cause);