diff options
author | 2009-06-24 17:36:15 +0000 | |
---|---|---|
committer | 2009-06-24 17:36:15 +0000 | |
commit | c752cdac5961151b8f954127be1c0686868ab9d9 (patch) | |
tree | 96a78bfa376c4c7a617e25fd081846bc8c09d6dc /usr.bin/tmux/server.c | |
parent | recvmsg ENOENT noncritical too (diff) | |
download | wireguard-openbsd-c752cdac5961151b8f954127be1c0686868ab9d9.tar.xz wireguard-openbsd-c752cdac5961151b8f954127be1c0686868ab9d9.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.
Diffstat (limited to 'usr.bin/tmux/server.c')
-rw-r--r-- | usr.bin/tmux/server.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index 642f38c842c..d60b5f33e33 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.1 2009/06/01 22:58:49 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.2 2009/06/24 17:36:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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; } |