Only set saved_layout_cell if creating a new cell, avoids crash when

respawning pane. Reported by Mingjie Shen in GitHubb issue 5143.
This commit is contained in:
nicm
2026-06-01 19:56:26 +00:00
parent f6557d1ea2
commit a1873fef61

View File

@@ -271,7 +271,8 @@ spawn_pane(struct spawn_context *sc, char **cause)
sc->wp0->ictx = NULL; sc->wp0->ictx = NULL;
new_wp = sc->wp0; new_wp = sc->wp0;
new_wp->flags &= ~(PANE_STATUSREADY|PANE_STATUSDRAWN); new_wp->flags &= ~(PANE_STATUSREADY|PANE_STATUSDRAWN);
} else if (sc->lc == NULL) { } else {
if (sc->lc == NULL) {
new_wp = window_add_pane(w, NULL, hlimit, sc->flags); new_wp = window_add_pane(w, NULL, hlimit, sc->flags);
layout_init(w, new_wp); layout_init(w, new_wp);
} else { } else {
@@ -288,6 +289,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
*/ */
if (w->flags & WINDOW_ZOOMED) if (w->flags & WINDOW_ZOOMED)
new_wp->saved_layout_cell = new_wp->layout_cell; new_wp->saved_layout_cell = new_wp->layout_cell;
}
/* /*
* Now we have a pane with nothing running in it ready for the new * Now we have a pane with nothing running in it ready for the new