fix(keybindings): resolve Cmd+Shift+E collision on macOS (#8533) (#9007)

This commit is contained in:
Neil
2026-07-16 17:20:21 -07:00
committed by GitHub
parent 3a74721f89
commit ea3ca547a7
2 changed files with 38 additions and 1 deletions
+35
View File
@@ -717,6 +717,41 @@ describe('keybindings', () => {
).toBe(true)
})
// Why: #8533 — both previously defaulted to Mod+Shift+E on darwin; emulator won.
it('keeps explorer on Mod+Shift+E and gives the mobile emulator a non-colliding macOS default', () => {
expect(getEffectiveKeybindingsForAction('sidebar.explorer.toggle', 'darwin')).toEqual([
'Mod+Shift+E'
])
expect(getEffectiveKeybindingsForAction('tab.newSimulator', 'darwin')).toEqual([
'Mod+Alt+Shift+E'
])
expect(getEffectiveKeybindingsForAction('tab.newSimulator', 'linux')).toEqual([])
expect(getEffectiveKeybindingsForAction('tab.newSimulator', 'win32')).toEqual([])
expect(formatKeybindingList(['Mod+Alt+Shift+E'], 'darwin')).toBe('⌘⌥⇧E')
expect(
keybindingMatchesAction(
'sidebar.explorer.toggle',
{ key: 'e', code: 'KeyE', meta: true, control: false, alt: false, shift: true },
'darwin'
)
).toBe(true)
expect(
keybindingMatchesAction(
'tab.newSimulator',
{ key: 'e', code: 'KeyE', meta: true, control: false, alt: false, shift: true },
'darwin'
)
).toBe(false)
expect(
keybindingMatchesAction(
'tab.newSimulator',
{ key: 'e', code: 'KeyE', meta: true, control: false, alt: true, shift: true },
'darwin'
)
).toBe(true)
})
it('defines an unassigned per-agent tab action for every TUI agent', () => {
for (const agent of ALL_TUI_AGENTS) {
const actionId = agentTabActionId(agent)
+3 -1
View File
@@ -567,8 +567,10 @@ export const KEYBINDING_DEFINITIONS: readonly KeybindingDefinition[] = [
group: 'Tabs',
scope: 'tabs',
searchKeywords: ['shortcut', 'tab', 'simulator', 'emulator', 'mobile', 'ios', 'new'],
// Why: keep explorer on Mod+Shift+E (VS Code muscle memory). Emulator is
// macOS-only and less common, so it yields to a free chord (#8533).
defaultBindings: {
darwin: ['Mod+Shift+E'],
darwin: ['Mod+Alt+Shift+E'],
linux: [],
win32: []
}