Make it so using kill-pane to destroy the last pane in a window destroys the

window instead of being an error.
This commit is contained in:
Nicholas Marriott
2009-07-17 20:37:03 +00:00
parent 6f5150a943
commit 0ca6f667e3
5 changed files with 39 additions and 29 deletions

View File

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