mirror of
https://github.com/tmux/tmux.git
synced 2026-06-04 00:56:17 +00:00
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:
32
spawn.c
32
spawn.c
@@ -271,23 +271,25 @@ 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) {
|
|
||||||
new_wp = window_add_pane(w, NULL, hlimit, sc->flags);
|
|
||||||
layout_init(w, new_wp);
|
|
||||||
} else {
|
} else {
|
||||||
new_wp = window_add_pane(w, sc->wp0, hlimit, sc->flags);
|
if (sc->lc == NULL) {
|
||||||
if (sc->flags & SPAWN_ZOOM)
|
new_wp = window_add_pane(w, NULL, hlimit, sc->flags);
|
||||||
layout_assign_pane(sc->lc, new_wp, 1);
|
layout_init(w, new_wp);
|
||||||
else
|
} else {
|
||||||
layout_assign_pane(sc->lc, new_wp, 0);
|
new_wp = window_add_pane(w, sc->wp0, hlimit, sc->flags);
|
||||||
}
|
if (sc->flags & SPAWN_ZOOM)
|
||||||
|
layout_assign_pane(sc->lc, new_wp, 1);
|
||||||
|
else
|
||||||
|
layout_assign_pane(sc->lc, new_wp, 0);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If window currently zoomed, window_set_active_pane calls
|
* If window currently zoomed, window_set_active_pane calls
|
||||||
* window_unzoom which it copies back the saved_layout_cell.
|
* window_unzoom which it copies back the saved_layout_cell.
|
||||||
*/
|
*/
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user