From 7c2fd0d7223cf0b1156938552e51f7c21abd2113 Mon Sep 17 00:00:00 2001 From: aanil677 Date: Fri, 15 May 2026 18:53:43 -0400 Subject: [PATCH] fix(search): alternative Go to Symbol in Workspace shortcut on web Ctrl/Cmd+T opens a new browser tab; keep it for desktop only. On web (Codespaces, vscode.dev) bind Go to Symbol in Workspace to Ctrl+K G. Fixes #232381. Co-authored-by: Cursor --- .../search/browser/searchActionsSymbol.ts | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/vs/workbench/contrib/search/browser/searchActionsSymbol.ts b/src/vs/workbench/contrib/search/browser/searchActionsSymbol.ts index 8be969e07884c..6355ccb993609 100644 --- a/src/vs/workbench/contrib/search/browser/searchActionsSymbol.ts +++ b/src/vs/workbench/contrib/search/browser/searchActionsSymbol.ts @@ -8,7 +8,8 @@ import { ServicesAccessor } from '../../../../platform/instantiation/common/inst import * as Constants from '../common/constants.js'; import { Action2, MenuId, registerAction2 } from '../../../../platform/actions/common/actions.js'; import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js'; -import { KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js'; +import { IsWebContext } from '../../../../platform/contextkey/common/contextkeys.js'; import { IQuickInputService } from '../../../../platform/quickinput/common/quickInput.js'; //#region Actions @@ -27,10 +28,21 @@ registerAction2(class ShowAllSymbolsAction extends Action2 { mnemonicTitle: nls.localize({ key: 'miGotoSymbolInWorkspace', comment: ['&& denotes a mnemonic'] }, "Go to Symbol in &&Workspace..."), }, f1: true, - keybinding: { - weight: KeybindingWeight.WorkbenchContrib, - primary: KeyMod.CtrlCmd | KeyCode.KeyT - }, + // Browsers handle Ctrl/Cmd+T (new tab). Use an alternate default on web (e.g. Codespaces). + // Avoid Ctrl+K T: it is used by notebook output collapse/expand with overlapping context. + // https://github.com/microsoft/vscode/issues/232381 + keybinding: [ + { + weight: KeybindingWeight.WorkbenchContrib, + primary: KeyMod.CtrlCmd | KeyCode.KeyT, + when: IsWebContext.toNegated() + }, + { + weight: KeybindingWeight.WorkbenchContrib, + primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyCode.KeyG), + when: IsWebContext + } + ], menu: { id: MenuId.MenubarGoMenu, group: '3_global_nav',