Add keybindings to reorder terminal groups#317521
Open
agners wants to merge 3 commits into
Open
Conversation
Introduce Move Terminal Group Forward/Backward actions bound to Ctrl+Shift+PageDown / Ctrl+Shift+PageUp, mirroring the existing Ctrl+PageDown / Ctrl+PageUp focus next/previous chord. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Up/Down matches the vertical tabs list better than Forward/Backward. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds new terminal commands and keybindings to reorder the active terminal group within the terminal tabs list (with wrap-around), integrating the feature via ITerminalGroupService and wiring it into the terminal action registry.
Changes:
- Introduces
Move Terminal Group Forward/Backwardcommands and adds them to the terminal command ID set + “skip shell” defaults. - Implements group reordering in
TerminalGroupServiceby splicing the active group withingroups[]and emitting change events. - Registers keybindings (
Ctrl/Cmd+Shift+PageDown/Ctrl/Cmd+Shift+PageUp) scoped to terminal focus, and updates test service stubs and the group service interface.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/test/browser/workbenchTestServices.ts | Updates TestTerminalGroupService to include the new API methods. |
| src/vs/workbench/contrib/terminal/common/terminal.ts | Adds new command IDs and includes them in DEFAULT_COMMANDS_TO_SKIP_SHELL. |
| src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts | Implements the actual group reordering logic and emits change events. |
| src/vs/workbench/contrib/terminal/browser/terminalActions.ts | Registers the new commands, titles, and keybindings, wiring them to the service. |
| src/vs/workbench/contrib/terminal/browser/terminal.ts | Extends ITerminalGroupService with the new move methods. |
Author
Author
|
@microsoft-github-policy-service agree |
activeGroupIndex can be -1 (or otherwise out of bounds) when no group is active; splice(-1, 1) would silently move the last group. Bail out instead. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Ctrl+Shift+PageUp/Ctrl+Shift+PageDownwhen a terminal is focused, mirroring the existingCtrl+PageUp/Ctrl+PageDownfocus-previous/next chord (and matching the editor's Move Editor Left/Right pattern, scoped bywhenso there's no conflict).moveActiveGroupUp/moveActiveGroupDownonITerminalGroupService, splicing the active group withingroups[]and firing the existing change events.Test plan
Ctrl+Shift+PageDown— active group moves down in the tabs list; repeat to wrap around to the top.Ctrl+Shift+PageUp— moves up and wraps to the bottom.Ctrl+PageUp/Ctrl+PageDownstill focus previous/next without reordering.🤖 Generated with Claude Code