Repository navigation
fix(web): let Escape reach nvim in the terminal drawer - #7203
maslinedwin wants to merge 1 commit into
Conversation
Bare Escape was treated as a UI chord, so vim/nvim never left insert mode. Forward unclaimed Escape to the PTY; keep mod+w as close.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
ApprovabilityVerdict: Needs human review This PR changes Escape key handling behavior across multiple components to fix terminal/vim interaction. Keyboard shortcut changes warrant human review to verify the intended user experience and ensure no regressions in command palette, dialog, or other Escape-sensitive interactions. You can customize Macroscope's approvability policy. Learn more. |
|
Note: GPT-6 on behalf of shivam (@shivamhwp). The Caps Lock remapping case in the latest issue comment remains unresolved. Please handle semantic Escape at the encoder boundary and cover the remapped event through |
|
Note This comment is posted by Julius' dot Closing for missing interaction verification. This changes Escape routing across the terminal and global handlers, but the PR reports no focused test results or before/after recording of vim entering command mode. The screenshots in #6362 show the original failure and a cmux comparison. Add results from the changed branch and a short recording covering Escape in the terminal and with an overlay open, including the reported remapped Escape case, then request reconsideration. |
Fixes #6362
Escape in the terminal drawer never reached the PTY, so vim/nvim stayed in insert mode and
:qcould not be entered. Default close is stillmod+w.When the terminal has focus and no overlay (command palette, dialog) is open, bare Escape is no longer treated as a close/dismiss chord.
beforeKeyreturns true so Ghostty encodes ESC.mod+w, split/toggle, and navigation/delete/clear shortcuts are unchanged.Grok / T3 Code
Note
Low Risk
Keyboard routing and terminal UX only; no auth, data, or API changes, with broad unit test coverage.
Overview
Fixes bare Escape being swallowed before it reaches the PTY in the thread terminal, so vim/nvim can use Escape normally; terminal close stays on
mod+w.A shared
decideTerminalBeforeKeypath now treats unmodified Escape as encode (not close), while keeping existing behavior for close, split/toggle, navigation, delete, and clear. ChatView and_chatskip their Escape handlers when the terminal has focus and the command palette is closed, so overlays still own Escape when open. Thread selection is no longer cleared by Escape while the terminal is focused.Reviewed by Cursor Bugbot for commit 6248904. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix bare Escape key pass-through to nvim in the terminal drawer
isBareEscapeKeyanddecideTerminalBeforeKeyutilities interminalBeforeKey.tsto consolidate terminal key-handling decisions (encode, suppress, or send a control sequence).ChatView.tsxto skip shortcut processing when a bare Escape is pressed while a terminal has focus and the command palette is closed.ThreadTerminalDrawer.tsxto usedecideTerminalBeforeKeyinstead of inline shortcut checks, letting bare Escape reach the PTY._chat.tsxso pressing Escape while the terminal is focused no longer clears selected threads.Macroscope summarized 6248904.