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

7
grid.c
View File

@@ -375,14 +375,17 @@ grid_trim_history(struct grid *gd, u_int ny)
* and shift up.
*/
void
grid_collect_history(struct grid *gd)
grid_collect_history(struct grid *gd, int all)
{
u_int ny;
if (gd->hsize == 0 || gd->hsize < gd->hlimit)
return;
ny = gd->hlimit / 10;
if (all)
ny = gd->hsize - gd->hlimit;
else
ny = gd->hlimit / 10;
if (ny < 1)
ny = 1;
if (ny > gd->hsize)