Skip to content

sessions: separate keybindings for grid focus vs open-from-list - #320684

Merged
Sandeep Somavarapu (sandy081) merged 1 commit into
mainfrom
sandy081/sessions-grid-session-keybindings
Jun 9, 2026
Merged

Sandeep Somavarapu (sandy081) merged 1 commit into
mainfrom
sandy081/sessions-grid-session-keybindings

Conversation

@sandy081

Copy link
Copy Markdown
Member

What

In the agents window, Ctrl/Cmd+1..9 was bound to two distinct command families at the same weight and when context, so they collided:

  • Focus Session in Grid — focus a session already open in the grid (sessions.focusSessionInGrid*).
  • Open Session from list — open the Nth session from the sessions list (sessionsViewPane.openSessionAtIndex*).

On Windows both resolved to Ctrl+1..9, so only one ever ran from the keyboard, producing the reported inconsistencies.

Changes

  • Focus Session in Grid keeps Ctrl/Cmd+1..9 and now treats 9 as the LAST grid slot (matching core's Focus Last Editor Group), instead of literally the 9th. Title for position 9 is now "Focus Last Session in Grid".
  • Open Session from list moves off Ctrl+1..9 to:
    • Windows/Linux: Alt+1..9
    • macOS: Ctrl+1..9 (WinCtrl) — the grid uses Cmd+1..9 there, so Ctrl is free, and this avoids Option+digit typing symbols.

Net result: Ctrl/Cmd = focus grid slot, Alt (Win/Linux) / Ctrl (mac) = open from list, with 9 = last consistent across both families.

Fixes

Notes for reviewers

  • No conflicts on either platform after the split.
  • "Focus Session in Grid N" doing nothing when that slot isn't open is intentional and consistent with core's Focus Editor Group N.

Ctrl/Cmd+1..9 collided between two distinct command families in the agents
window: focusing a session already open in the grid vs opening the Nth session
from the list. On Windows both resolved to Ctrl+1..9, producing inconsistent
behavior (#320552) and Ctrl+9 opening the last session instead of the 9th
(#320553).

- Focus Session in Grid keeps Ctrl/Cmd+1..9 and now treats 9 as the LAST slot,
  matching core's Focus Last Editor Group.
- Open Session from list moves to Alt+1..9 (Win/Linux) and Ctrl+1..9 (macOS,
  WinCtrl) to avoid the collision and Option+digit symbol input on macOS.

Co-authored-by: Copilot <[email protected]>
Copilot AI review requested due to automatic review settings June 9, 2026 22:05
@sandy081 Sandeep Somavarapu (sandy081) added this to the 1.125.0 milestone Jun 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR resolves keybinding collisions in the Agents (sessions) window by separating the shortcuts for “focus an already-open session in the grid” vs “open the Nth session from the sessions list”, and by making the 9 binding consistently mean “last” (mirroring core editor-group behavior).

Changes:

  • Rebind “Open Session from list at index 1..9” to Alt+1..9 on Windows/Linux and Ctrl+1..9 on macOS (WinCtrl), avoiding collisions with grid-focus bindings.
  • Update “Focus Session in Grid 1..9” so 9 focuses the last open grid slot (and rename the command title accordingly).
Show a summary per file
File Description
src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.ts Moves the “open from list at index” keybindings off Ctrl/Cmd+1..9 (platform-specific split) while keeping behavior that 9 targets the last item.
src/vs/sessions/contrib/sessions/browser/sessionsActions.ts Adjusts grid-focus actions so 9 targets the last visible grid slot and updates the command title for position 9.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

@sandy081
Sandeep Somavarapu (sandy081) merged commit 676947b into main Jun 9, 2026
26 checks passed
@sandy081
Sandeep Somavarapu (sandy081) deleted the sandy081/sessions-grid-session-keybindings branch June 9, 2026 22:37
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Jul 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Focus Session in Grid 9 opens last session instead of 9th session Inconsistent behavior of Focus Session in Grid commands

3 participants