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();