Add detach-on-destroy previous and next, mostly from Alexis Hildebrandt.

This commit is contained in:
nicm
2023-09-01 13:48:54 +00:00
parent 71d453f169
commit c1e6e54e6e
4 changed files with 44 additions and 34 deletions

View File

@ -367,11 +367,9 @@ session_detach(struct session *s, struct winlink *wl)
session_group_synchronize_from(s);
if (RB_EMPTY(&s->windows)) {
session_destroy(s, 1, __func__);
if (RB_EMPTY(&s->windows))
return (1);
}
return (0);
return (0);
}
/* Return if session has window. */