From 1f5679cc539bf26ae5790e9009aa42444cfe594e Mon Sep 17 00:00:00 2001 From: ulugbekna Date: Thu, 4 Jun 2026 16:44:18 +0200 Subject: [PATCH] Fix Ctrl+Tab/Ctrl+Shift+Tab session navigation in Agents window The `sessions.goBack`/`sessions.goForward` actions registered Ctrl+Shift+Tab and Ctrl+Tab as secondary keybindings at `WorkbenchContrib` the sameweight chords and weight as the editor quick-open actions. With equal weight the editor actions won the conflict in the Agents window, so the chords never triggered session navigation. Bump the weight to `WorkbenchContrib + 1` so the session bindings win. The the Agents window, leaving the main workbench Ctrl+Tab behavior untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../sessions/contrib/sessions/browser/sessionsActions.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/sessions/contrib/sessions/browser/sessionsActions.ts b/src/vs/sessions/contrib/sessions/browser/sessionsActions.ts index 0a3acc616c38fe..948c5224a446ba 100644 --- a/src/vs/sessions/contrib/sessions/browser/sessionsActions.ts +++ b/src/vs/sessions/contrib/sessions/browser/sessionsActions.ts @@ -129,7 +129,9 @@ registerAction2(class GoBackAction extends Action2 { category: SessionsCategories.Sessions, precondition: CanGoBackContext, keybinding: { - weight: KeybindingWeight.WorkbenchContrib, + // Higher than `WorkbenchContrib` so the `Ctrl+Shift+Tab` secondary wins over the + // editor quick-open actions (which bind the same chord at `WorkbenchContrib`). + weight: KeybindingWeight.WorkbenchContrib + 1, win: { primary: KeyMod.Alt | KeyCode.LeftArrow, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab] }, mac: { primary: KeyMod.WinCtrl | KeyCode.Minus, secondary: [KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Tab] }, linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Minus, secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Tab] }, @@ -169,7 +171,9 @@ registerAction2(class GoForwardAction extends Action2 { category: SessionsCategories.Sessions, precondition: CanGoForwardContext, keybinding: { - weight: KeybindingWeight.WorkbenchContrib, + // Higher than `WorkbenchContrib` so the `Ctrl+Tab` secondary wins over the + // editor quick-open actions (which bind the same chord at `WorkbenchContrib`). + weight: KeybindingWeight.WorkbenchContrib + 1, win: { primary: KeyMod.Alt | KeyCode.RightArrow, secondary: [KeyMod.CtrlCmd | KeyCode.Tab] }, mac: { primary: KeyMod.WinCtrl | KeyMod.Shift | KeyCode.Minus, secondary: [KeyMod.WinCtrl | KeyCode.Tab] }, linux: { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.Minus, secondary: [KeyMod.CtrlCmd | KeyCode.Tab] },