Repository navigation
Fix Escape key not working in terminal panels (e.g. lazygit) - #1957
Conversation
The `shouldConsumeSuppressedEscape` function had an early return that unconditionally consumed all repeated Escape key events (`isARepeat`), regardless of whether the suppression window had expired. This caused Escape presses to be swallowed in TUI apps (e.g. lazygit) running in panels, because the repeat events never reached the active responder. Removing the `isARepeat` guard lets repeated Escapes fall through to the existing time-based check (0.35s window), which correctly expires and stops consuming events after the command palette is dismissed. Fixes manaflow-ai#1610 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Someone is attempting to deploy a commit to the Manaflow Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis change modifies the escape key suppression logic in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR removes a 3-line
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant EventMonitor
participant shouldConsumeSuppressedEscape
participant Terminal
User->>EventMonitor: Esc keyDown (dismiss palette)
EventMonitor->>EventMonitor: beginCommandPaletteEscapeSuppression(startedAt=t0)
EventMonitor->>EventMonitor: dismiss palette → return true (consumed)
Note over User,Terminal: User continues holding Esc (repeat events)
User->>EventMonitor: Esc keyDown (isARepeat=true, t0+0.1s)
EventMonitor->>shouldConsumeSuppressedEscape: check suppression
shouldConsumeSuppressedEscape-->>EventMonitor: elapsed=0.1s ≤ 0.35s → true (consumed)
User->>EventMonitor: Esc keyDown (isARepeat=true, t0+0.4s)
EventMonitor->>shouldConsumeSuppressedEscape: check suppression
shouldConsumeSuppressedEscape->>shouldConsumeSuppressedEscape: elapsed=0.4s > 0.35s → endSuppression()
shouldConsumeSuppressedEscape-->>EventMonitor: false (pass through)
EventMonitor->>Terminal: Esc delivered ✓
User->>EventMonitor: Esc keyUp
EventMonitor->>EventMonitor: clearEscapeSuppressionForKeyUp() (no-op, already cleared)
Reviews (1): Last reviewed commit: "fix: stop consuming repeated Escape keys..." | Re-trigger Greptile |
|
Thank you for the contribution! |
…-panels Fix Escape key not working in terminal panels (e.g. lazygit)
Summary
shouldConsumeSuppressedEscapehad anisARepeatearly return that unconditionally swallowed all repeated Escape key events, with no time limitisARepeatguard so repeated Escapes fall through to the existing 0.35s time-based check, which correctly expiresRoot Cause
Test plan
?to open help, press Esc → dialog closesFixes #1610
🤖 Generated with Claude Code
Summary by cubic
Fixes Escape not working in terminal panels and TUIs after dismissing the command palette. Repeated Escapes are no longer consumed indefinitely and now respect the 0.35s suppression window. Fixes #1610.
isARepeatearly return inshouldConsumeSuppressedEscape, letting repeats pass the 0.35s time-based check.Written for commit 5de59cd. Summary will update on new commits.
Summary by CodeRabbit