summaryrefslogtreecommitdiffstats
path: root/cmd-move-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-move-window.c')
-rw-r--r--cmd-move-window.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd-move-window.c b/cmd-move-window.c
index 5e30d6b5..6268226e 100644
--- a/cmd-move-window.c
+++ b/cmd-move-window.c
@@ -47,11 +47,10 @@ cmd_move_window_exec(struct cmd *self, struct cmd_ctx *ctx)
char *cause;
int idx, kflag, dflag;
- if ((s = ctx->curclient->session) == NULL)
- return (-1);
+ if (args_has(args, 'r')) {
+ if ((s = cmd_find_session(ctx, args_get(args, 't'), 0)) == NULL)
+ return (-1);
- if (args_has(args, 'r'))
- {
session_renumber_windows(s);
recalculate_sizes();