diff options
Diffstat (limited to 'usr.bin/tmux/cmd-kill-window.c')
-rw-r--r-- | usr.bin/tmux/cmd-kill-window.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-kill-window.c b/usr.bin/tmux/cmd-kill-window.c index 499929c0744..a70cbd17180 100644 --- a/usr.bin/tmux/cmd-kill-window.c +++ b/usr.bin/tmux/cmd-kill-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-window.c,v 1.17 2015/05/06 08:35:39 nicm Exp $ */ +/* $OpenBSD: cmd-kill-window.c,v 1.18 2015/12/13 14:32:38 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -30,7 +30,7 @@ const struct cmd_entry cmd_kill_window_entry = { "kill-window", "killw", "at:", 0, 0, "[-a] " CMD_TARGET_WINDOW_USAGE, - 0, + CMD_WINDOW_T, cmd_kill_window_exec }; @@ -38,21 +38,17 @@ const struct cmd_entry cmd_unlink_window_entry = { "unlink-window", "unlinkw", "kt:", 0, 0, "[-k] " CMD_TARGET_WINDOW_USAGE, - 0, + CMD_WINDOW_T, cmd_kill_window_exec }; enum cmd_retval cmd_kill_window_exec(struct cmd *self, struct cmd_q *cmdq) { - struct args *args = self->args; - struct winlink *wl, *wl2, *wl3; - struct window *w; - struct session *s; - - if ((wl = cmd_find_window(cmdq, args_get(args, 't'), &s)) == NULL) - return (CMD_RETURN_ERROR); - w = wl->window; + struct args *args = self->args; + struct winlink *wl = cmdq->state.tflag.wl, *wl2, *wl3; + struct window *w = wl->window; + struct session *s = cmdq->state.tflag.s; if (self->entry == &cmd_unlink_window_entry) { if (!args_has(self->args, 'k') && !session_is_linked(s, w)) { |