From 4fafbf5fe63d3446a14317ac4f99515c44c38643 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 1 Aug 2026 22:17:57 -0700 Subject: [PATCH] Record why post-blur letter releases arm the candidate guard The pinned behavior looks like a false positive until you check what ignoring it would cost on the first commit after focus. Co-authored-by: Orca --- .../terminal-pane/terminal-ime-linux-candidate-state.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.ts b/src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.ts index 3e0f6942bdc..904d83cd25b 100644 --- a/src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.ts +++ b/src/renderer/src/components/terminal-pane/terminal-ime-linux-candidate-state.ts @@ -55,6 +55,10 @@ function acquirePhysicalKeyTracker( pressedCodes.delete(code) } } + // A key held across the blur then released on return reads as orphaned and arms the + // guard for one digit. Deliberate: not clearing would strand the code as pressed, and + // treating post-blur keyups as unknowable would miss the orphan on the first commit + // after focus, which is the common case. const reset = (): void => pressedCodes.clear() // Why: bubble-phase keyup cleanup runs after xterm's target handler, so the // pane can still classify that release against the shared pressed-key set.