From 4d6a7757b87dd1cf93405c35dce21af610363d05 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 23 Feb 2026 02:21:41 +0900 Subject: [PATCH] Fix adaptive height calculation to exclude header lines The adaptive height (--height ~100%) was using the raw chunklist count including header items, making the window too tall by headerLines rows. --- src/core.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.go b/src/core.go index 414d7e8d..7b980ccf 100644 --- a/src/core.go +++ b/src/core.go @@ -323,10 +323,11 @@ func Run(opts *Options) (int, error) { query := []rune{} determine := func(final bool) { if heightUnknown { - if total >= maxFit || final { + items := max(0, total-int(headerLines)) + if items >= maxFit || final { deferred = false heightUnknown = false - terminal.startChan <- fitpad{min(total, maxFit), padHeight} + terminal.startChan <- fitpad{min(items, maxFit), padHeight} } } else if deferred { deferred = false