summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-move-window.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2012-05-13 07:33:31 +0000
committernicm <nicm@openbsd.org>2012-05-13 07:33:31 +0000
commit559d633532d33143e3aefcab1ad8efee5a4543b0 (patch)
tree581755ea3c17ab662ae43989b7d5f1a2b0f5e6c6 /usr.bin/tmux/cmd-move-window.c
parentAdd "Match LocalAddress" and "Match LocalPort" to sshd and adjust tests (diff)
downloadwireguard-openbsd-559d633532d33143e3aefcab1ad8efee5a4543b0.tar.xz
wireguard-openbsd-559d633532d33143e3aefcab1ad8efee5a4543b0.zip
Use -t for move-window with -r rather than dying. Reported by Ben
Boeckel and Thomas Adam.
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();