summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-05-13 07:33:32 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-05-13 07:33:32 +0000
commita9f5bf8bdb4ec8e93d946c9bd18bad81311dffdd (patch)
treee8e01bd43598b498328fe18ffa585d5d1a52622e /usr.bin
parent23f5a4eccb89e285c41dbb45d15e63ccd7a0e7a0 (diff)
Use -t for move-window with -r rather than dying. Reported by Ben
Boeckel and Thomas Adam.
Diffstat (limited to 'usr.bin')
-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();