Block 'start:wait' during initial load

- Init searchInProgress before reader starts so start:wait waits for
  the first complete result set instead of no-op'ing
- Add test_wait_action_start
This commit is contained in:
Junegunn Choi
2026-07-01 18:49:20 +09:00
parent 1d9d7cd417
commit 6358d6f4f1
2 changed files with 17 additions and 1 deletions
+5 -1
View File
@@ -1169,7 +1169,11 @@ func NewTerminal(opts *Options, eventBox *util.EventBox, executor *util.Executor
lastAction: actStart,
lastFocus: minItem.Index(),
lastActivity: time.Now(),
numLinesCache: make(map[int32]numLinesCacheValue)}
// Consider the initial load a search in progress so 'start:wait' blocks
// until the first result set is complete. Set here, before the reader
// starts, so the first final() result correctly clears it.
searchInProgress: true,
numLinesCache: make(map[int32]numLinesCacheValue)}
if opts.AcceptNth != nil {
t.acceptNth = opts.AcceptNth(t.delimiter)
}