summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-move-window.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-move-window.c')
-rw-r--r--usr.bin/tmux/cmd-move-window.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.bin/tmux/cmd-move-window.c b/usr.bin/tmux/cmd-move-window.c
index 070e548b5b2..4da31af35d6 100644
--- a/usr.bin/tmux/cmd-move-window.c
+++ b/usr.bin/tmux/cmd-move-window.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-move-window.c,v 1.11 2012/04/29 17:20:01 nicm Exp $ */
+/* $OpenBSD: cmd-move-window.c,v 1.12 2012/05/13 07:33:31 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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();