aboutsummaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:01:42 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-06-25 16:01:42 +0000
commit944520b3a87720c406e1a563657477d73c430fd2 (patch)
tree8612c88372b1682958c5bea291c991adafe0d8ee /server.c
parent942ea4267d0362fb0031ed995195d9c4e45bcdfb (diff)
downloadrtmux-944520b3a87720c406e1a563657477d73c430fd2.tar.gz
rtmux-944520b3a87720c406e1a563657477d73c430fd2.tar.bz2
rtmux-944520b3a87720c406e1a563657477d73c430fd2.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 'server.c')
-rw-r--r--server.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/server.c b/server.c
index b5308578..779959f9 100644
--- a/server.c
+++ b/server.c
@@ -1,4 +1,4 @@
-/* $Id: server.c,v 1.145 2009-05-19 13:32:55 tcunha Exp $ */
+/* $OpenBSD: server.c,v 1.2 2009/06/24 17:36:15 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -980,7 +980,7 @@ server_check_window_content(
return (1);
}
-/* Check if window still exists.. */
+/* Check if window still exists. */
void
server_check_window(struct window *w)
{
@@ -998,13 +998,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;
}