When history-limit is changed, apply to existing panes, not just new

ones. GitHub issue 4705.
This commit is contained in:
nicm
2026-01-22 08:55:01 +00:00
parent ecbf8d76d0
commit 195a9cfd88
7 changed files with 45 additions and 8 deletions

View File

@@ -768,3 +768,29 @@ session_theme_changed(struct session *s)
}
}
}
/* Update history for all panes. */
void
session_update_history(struct session *s)
{
struct winlink *wl;
struct window_pane *wp;
struct grid *gd;
u_int limit, osize;
limit = options_get_number(s->options, "history-limit");
RB_FOREACH(wl, winlinks, &s->windows) {
TAILQ_FOREACH(wp, &wl->window->panes, entry) {
gd = wp->base.grid;
osize = gd->hsize;
gd->hlimit = limit;
grid_collect_history(gd, 1);
if (gd->hsize != osize) {
log_debug("%s: %%%u %u -> %u", __func__, wp->id,
osize, gd->hsize);
}
}
}
}