diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-14 18:53:09 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2017-01-14 18:53:09 +0000 |
commit | 04c0d479b956b5e4f4e20ce989b95443aa03da0b (patch) | |
tree | 95163c948cc790b7ba48c066f0f9a93e303a1cc6 /usr.bin/tmux/cmd-kill-pane.c | |
parent | af62dbaa887146e928f6825f865e145e51ac81ee (diff) |
killp -a should not kill the window if only one pane.
Diffstat (limited to 'usr.bin/tmux/cmd-kill-pane.c')
-rw-r--r-- | usr.bin/tmux/cmd-kill-pane.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/usr.bin/tmux/cmd-kill-pane.c b/usr.bin/tmux/cmd-kill-pane.c index 32205006ddf..2d0dfbb5bc1 100644 --- a/usr.bin/tmux/cmd-kill-pane.c +++ b/usr.bin/tmux/cmd-kill-pane.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-kill-pane.c,v 1.22 2016/10/16 19:04:05 nicm Exp $ */ +/* $OpenBSD: cmd-kill-pane.c,v 1.23 2017/01/14 18:53:08 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -49,13 +49,6 @@ cmd_kill_pane_exec(struct cmd *self, struct cmdq_item *item) server_unzoom_window(wl->window); - if (window_count_panes(wl->window) == 1) { - /* Only one pane, kill the window. */ - server_kill_window(wl->window); - recalculate_sizes(); - return (CMD_RETURN_NORMAL); - } - if (args_has(self->args, 'a')) { TAILQ_FOREACH_SAFE(loopwp, &wl->window->panes, entry, tmpwp) { if (loopwp == wp) @@ -63,11 +56,16 @@ cmd_kill_pane_exec(struct cmd *self, struct cmdq_item *item) layout_close_pane(loopwp); window_remove_pane(wl->window, loopwp); } + return (CMD_RETURN_NORMAL); + } + + if (window_count_panes(wl->window) == 1) { + server_kill_window(wl->window); + recalculate_sizes(); } else { layout_close_pane(wp); window_remove_pane(wl->window, wp); + server_redraw_window(wl->window); } - server_redraw_window(wl->window); - return (CMD_RETURN_NORMAL); } |