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.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);