Add cmd-shift-j and ctrl-shift-j keybindings to toggle terminal panel focus#51670
Add cmd-shift-j and ctrl-shift-j keybindings to toggle terminal panel focus#51670msmolkin wants to merge 1 commit intozed-industries:mainfrom
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Michael.
|
e49bef0 to
3b78a16
Compare
|
We require contributors to sign our Contributor License Agreement, and we don't have @msmolkin on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
|
@msmolkin We already have How do VSCode/Jetbrains panel toggling shortcuts work? I'd rather make the existing shortcuts work well than adding new ones. |
…2357) Follow-up to the discussion in #51670. @ConradIrwin, thanks for the review! You're right about the other editors. VS Code and JetBrains use dedicated shortcuts for bottom panel tabs, which exactly mirrors how `ctrl-`` already behaves in Zed, so we don't need a new keybinding. The reason I originally proposed `cmd-shift-j` was just to match the UI pattern of the Debugger, which clearly shows `cmd-shift-d` on hover. Because of a minor UI discoverability bug, the Terminal button's tooltip was completely blank, which made it look like it just lacked a shortcut entirely. It turns out the Terminal button's internal `toggle_action()` method was just telling the UI to look up `ToggleFocus` instead of `terminal_panel::Toggle` (which is what `ctrl-`` is actually bound to). I've updated this branch with a simple one-word fix that just points the `toggle_action` to the correct keymap. The existing `ctrl-`` shortcut now shows up perfectly in the hover tooltip. Good catch on the existing shortcuts, keeps this much cleaner. Co-authored-by: Michael Smolkin <[email protected]>
Closes #51668
This PR adds
cmd-shift-j(macOS) andctrl-shift-j(Linux/Windows) as default keybindings to toggle focus for the terminal panel.The rationale here is that if a user presses
cmd+shift+dto open the debug mode in the lower pane (which is usually reserved for the terminal and typically opened withcmd+j), they are currently forced to use the mouse to switch back to the terminal panel.Alternatively,
cmd+jcould be programmed to automatically switch back to the terminal when the lower panel is already open to debug mode, which would have fixed the issue. However, addingcmd-shift-jis a more consistent addition, cleanly matchingcmd-shift-dfor the debugger.Release Notes:
cmd-shift-j/ctrl-shift-jkeybindings to toggle terminal panel focus