diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-06-24 17:36:15 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-06-24 17:36:15 +0000 |
commit | da8401d8bee19d9f5394ddef0c7905b6a8ac9932 (patch) | |
tree | e3f3913f825e6e6c0d30f1e1981f23037ed7599e | |
parent | 2de599ac0ec0634282a52711378258e25839bc7f (diff) | |
download | rtmux-da8401d8bee19d9f5394ddef0c7905b6a8ac9932.tar.gz rtmux-da8401d8bee19d9f5394ddef0c7905b6a8ac9932.tar.bz2 rtmux-da8401d8bee19d9f5394ddef0c7905b6a8ac9932.zip |
Make remain-on-exit work again when there is only one pane left, which was
broken sometime during the pane/layout changes. Reported/tested by Iain Morgan,
thanks.
-rw-r--r-- | server.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -966,7 +966,7 @@ server_check_window_content( return (1); } -/* Check if window still exists.. */ +/* Check if window still exists. */ void server_check_window(struct window *w) { @@ -984,13 +984,18 @@ server_check_window(struct window *w) wp = TAILQ_FIRST(&w->panes); while (wp != NULL) { wq = TAILQ_NEXT(wp, entry); - if (wp->fd != -1) - destroyed = 0; - else if (!flag) { + /* + * If the pane has died and the remain-on-exit flag is not set, + * remove the pane; otherwise, if the flag is set, don't allow + * the window to be destroyed (or it'll close when the last + * pane dies). + */ + if (wp->fd == -1 && !flag) { window_remove_pane(w, wp); server_redraw_window(w); layout_refresh(w, 0); - } + } else + destroyed = 0; wp = wq; } |