summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-kill-pane.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/tmux/cmd-kill-pane.c')
-rw-r--r--usr.bin/tmux/cmd-kill-pane.c18
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);
}