summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-kill-pane.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-07-17 20:37:04 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-07-17 20:37:04 +0000
commit4bc25501db8414c43e694bbd75cc3e2c8e3c40d5 (patch)
treedd5fc5c9f31edad51426459d45326b13a8a1df23 /usr.bin/tmux/cmd-kill-pane.c
parentac7475a98ccdb093fb64cb987f661dda0598b077 (diff)
Make it so using kill-pane to destroy the last pane in a window destroys the
window instead of being an error.
Diffstat (limited to 'usr.bin/tmux/cmd-kill-pane.c')
-rw-r--r--usr.bin/tmux/cmd-kill-pane.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-kill-pane.c b/usr.bin/tmux/cmd-kill-pane.c
index c3b7b71297e..ca642e5df8c 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.2 2009/07/13 23:11:35 nicm Exp $ */
+/* $OpenBSD: cmd-kill-pane.c,v 1.3 2009/07/17 20:37:03 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -61,8 +61,9 @@ cmd_kill_pane_exec(struct cmd *self, struct cmd_ctx *ctx)
}
if (window_count_panes(wl->window) == 1) {
- ctx->error(ctx, "can't kill pane: %d", data->pane);
- return (-1);
+ /* Only one pane, kill the window. */
+ server_kill_window(wl->window);
+ return (0);
}
window_remove_pane(wl->window, wp);