From 6fdaaa06372302f0c35e128d34a9fbd19de9cd00 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 11 Sep 2017 06:40:46 +0000 Subject: Do not free more lines than are available in the history. --- grid.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/grid.c b/grid.c index c26db476..aa9aea4c 100644 --- a/grid.c +++ b/grid.c @@ -292,12 +292,14 @@ grid_collect_history(struct grid *gd) { u_int ny; - if (gd->hsize < gd->hlimit) + if (gd->hsize == 0 || gd->hsize < gd->hlimit) return; ny = gd->hlimit / 10; if (ny < 1) ny = 1; + if (ny > gd->hsize) + ny = gd->hsize; /* * Free the lines from 0 to ny then move the remaining lines over -- cgit From d8d6c2746ee5ddece53ad5b41ac9cf9c801ac94d Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 11 Sep 2017 06:53:06 +0000 Subject: Mention that filter is a format. --- tmux.1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tmux.1 b/tmux.1 index 112f5392..45eb83b2 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1403,7 +1403,9 @@ specifies the initial sort order: one of or .Ql activity . .Fl f -specifies an initial filter. +specifies an initial filter: the filter is a format - if it evaluates to zero, +the item in the list is not shown, otherwise it is shown. +If a filter would lead to an empty list, it is ignored. .Fl F specifies the format for each item in the list. .Fl N @@ -1460,7 +1462,9 @@ specifies the initial sort order: one of or .Ql time . .Fl f -specifies an initial filter. +specifies an initial filter: the filter is a format - if it evaluates to zero, +the item in the list is not shown, otherwise it is shown. +If a filter would lead to an empty list, it is ignored. .Fl F specifies the format for each item in the tree. .Fl N @@ -4111,7 +4115,9 @@ specifies the initial sort order: one of or .Ql size . .Fl f -specifies an initial filter. +specifies an initial filter: the filter is a format - if it evaluates to zero, +the item in the list is not shown, otherwise it is shown. +If a filter would lead to an empty list, it is ignored. .Fl F specifies the format for each item in the list. .Fl N -- cgit