feat(web): add rightPanel.openTerminal keybinding command - #7835
Conversation
|
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 |
terminal.new only creates a right-panel terminal when focus is already there (ChatView's terminalFocusOwner check), so there was no way to open a terminal in the right panel from the keyboard. Add a bindable rightPanel.openTerminal command, defaulting to mod+alt+j to mirror mod+alt+b for rightPanel.toggle, wired to the existing addTerminalSurface path. Cmd+J behavior is unchanged. Closes pingdotgg#4790
1280de0 to
002f817
Compare
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This PR adds a new keybinding command that exposes an existing function ( You can add or adjust custom eligibility rules. Learn more. |
Problem
There is no way to open a terminal in the right panel from the keyboard.
terminal.new(mod+n, and mod+j for the drawer) only creates a right-panel terminal when focus is already inside one — the chicken-and-egg problem described in #4790. Every other surface (drawer, diff, preview) has a bindable command; the right-panel terminal did not.Fix
Add an additive
rightPanel.openTerminalcommand:packages/contracts: registerrightPanel.openTerminalinSTATIC_KEYBINDING_COMMANDSpackages/shared: default bindingmod+alt+j, mirroringmod+alt+bforrightPanel.toggleapps/web: handle the command inChatViewby calling the existingaddTerminalSurface()pathSettings → Keybindings and the command-options list derive from those constants, so the new command appears there automatically and is rebindable like any other. Default bottom-drawer behavior is unchanged.
Closes #4790
Validation
packages/shared/src/keybindings.test.tsasserting the default binding⌘⌥J on macOS / Ctrl+Alt+J elsewhere opens a terminal as a right-panel surface.
Note
Low Risk
Additive keybinding that reuses existing terminal-open logic; no auth, data, or drawer-behavior changes.
Overview
Adds a bindable
rightPanel.openTerminalcommand so users can open a right-panel terminal from the keyboard without already focusing one.Default shortcut is
mod+alt+j(mirroringmod+alt+bfor the right panel).ChatViewhandles it by calling existingaddTerminalSurface(). Bottom-drawer terminal shortcuts are unchanged. Docs and a default-binding test are included.Reviewed by Cursor Bugbot for commit 002f817. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add
rightPanel.openTerminalkeybinding command bound tomod+alt+jRegisters the new
rightPanel.openTerminalcommand in the keybinding contracts and setsmod+alt+jas the default shortcut. TheChatViewContentcomponent handles the command by callingaddTerminalSurface()to open a terminal. Adds corresponding tests and updates the keybindings documentation.Macroscope summarized 002f817.