Skip to content

Add keybindings to reorder terminal groups#317521

Open
agners wants to merge 3 commits into
microsoft:mainfrom
agners:terminal/reorder-groups-keybinding
Open

Add keybindings to reorder terminal groups#317521
agners wants to merge 3 commits into
microsoft:mainfrom
agners:terminal/reorder-groups-keybinding

Conversation

@agners
Copy link
Copy Markdown

@agners agners commented May 20, 2026

Summary

  • Adds Move Terminal Group Up / Move Terminal Group Down commands that reorder the active terminal group in the tabs list, with wrap-around.
  • Binds them to Ctrl+Shift+PageUp / Ctrl+Shift+PageDown when a terminal is focused, mirroring the existing Ctrl+PageUp / Ctrl+PageDown focus-previous/next chord (and matching the editor's Move Editor Left/Right pattern, scoped by when so there's no conflict).
  • Implementation: new moveActiveGroupUp/moveActiveGroupDown on ITerminalGroupService, splicing the active group within groups[] and firing the existing change events.

Test plan

  • Open the panel, create 3+ terminal groups.
  • Focus a middle group, press Ctrl+Shift+PageDown — active group moves down in the tabs list; repeat to wrap around to the top.
  • Press Ctrl+Shift+PageUp — moves up and wraps to the bottom.
  • Ctrl+PageUp / Ctrl+PageDown still focus previous/next without reordering.
  • Run "Move Terminal Group Up/Down" from the Command Palette.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings May 20, 2026 13:03
Up/Down matches the vertical tabs list better than Forward/Backward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/Backward commands and adds them to the terminal command ID set + “skip shell” defaults.
  • Implements group reordering in TerminalGroupService by splicing the active group within groups[] 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.

Comment thread src/vs/workbench/contrib/terminal/browser/terminalGroupService.ts
@agners
Copy link
Copy Markdown
Author

agners commented May 20, 2026

image

@agners
Copy link
Copy Markdown
Author

agners commented May 20, 2026

@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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants