From 617f9e628c3d4b3945ae7d8422f0c91e167efbfe Mon Sep 17 00:00:00 2001 From: Barrett Ruth <62671086+barrettruth@users.noreply.github.com> Date: Fri, 28 Aug 2026 05:48:34 +1000 Subject: [PATCH] fix(session): window sizes lost in tabpages after an excluded window #41478 Problem: `restore_size` is scoped to all of `makeopens()`, so a window excluded by 'sessionoptions' latches it off for every tabpage written afterwards: with `sessionoptions-=terminal`, a terminal in tab 2 makes tab 3 restore with `wincmd =` instead of its stored sizes. Solution: Recompute it per tabpage. --- src/nvim/ex_session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nvim/ex_session.c b/src/nvim/ex_session.c index aaf36af061..b7127b22b3 100644 --- a/src/nvim/ex_session.c +++ b/src/nvim/ex_session.c @@ -587,7 +587,6 @@ static int store_session_globals(FILE *fd) static int makeopens(FILE *fd, char *dirnow) { bool only_save_windows = true; - bool restore_size = true; win_T *edited_win = NULL; win_T *tab_firstwin; frame_T *tab_topframe; @@ -823,6 +822,7 @@ static int makeopens(FILE *fd, char *dirnow) // Check if window sizes can be restored (no windows omitted). // Remember the window number of the current window after restoring. int nr = 0; + bool restore_size = true; for (win_T *wp = tab_firstwin; wp != NULL; wp = wp->w_next) { if (ses_do_win(wp)) { nr++;