From d46bfd005a8bb55b6e440da98470c23906982437 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 24 Aug 2026 09:22:28 +0900 Subject: [PATCH] Keep a minimum wait for a sequence in flight ESCDELAY=0 makes the retry count zero, so the wait added in d0377ed had no effect and the reply still leaked. Past the introducer these bytes cannot be the ESC key, so waiting for them adds no Escape latency. - Wait at least defaultEscDelay, honour a larger ESCDELAY - Lone ESC still honours ESCDELAY=0, measured 3ms to exit either way Fix #4899 --- src/tui/light.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tui/light.go b/src/tui/light.go index c425a570..bbc50dc4 100644 --- a/src/tui/light.go +++ b/src/tui/light.go @@ -420,8 +420,10 @@ func (r *LightRenderer) getBytesInternal(cancellable bool, buffer []byte, nonblo buffer = append(buffer, byte(c)) // Keep waiting while a sequence is still arriving. Dropping the budget // after every byte left fzf parsing whatever the read happened to end on. + // Past the introducer this is not the ESC key, so the wait costs no + // Escape latency and ESCDELAY=0 must not reduce it to nothing. if retries == 0 && incompleteEscape(buffer) { - retries = r.escDelay / escPollInterval + retries = max(r.escDelay, defaultEscDelay) / escPollInterval } pc = c