Skip to content

Keybindings.json - cannot read property length of undefined #69146

@isidorn

Description

@isidorn
  1. Open keybindings.json
  2. Do some modifications -> notice exception in dev tools
TypeError: Cannot read property 'length' of undefined
    at MacLinuxKeyboardMapper._generateResolvedKeybindings (macLinuxKeyboardMapper.js:812)
    at MacLinuxKeyboardMapper.resolveUserBinding (macLinuxKeyboardMapper.js:882)
    at CachedKeyboardMapper.resolveUserBinding (keyboardMapper.js:30)
    at WorkbenchKeybindingService.resolveUserBinding (keybindingService.js:346)
    at KeybindingEditorDecorationsRenderer._getDecorationForEntry (keybindingsEditorContribution.js:180)
    at KeybindingEditorDecorationsRenderer._updateDecorationsNow (keybindingsEditorContribution.js:152)
    at RunOnceScheduler.KeybindingEditorDecorationsRenderer._updateDecorations._register.async_1.RunOnceScheduler [as runner] (keybindingsEditorContribution.js:133)
    at RunOnceScheduler.doRun (async.js:500)
    at RunOnceScheduler.onTimeout (async.js:495)

In case you can not repro, here are the contents of my keybindings.json at the time of the exception

// Place your key bindings in this file to overwrite the defaults
[
  
{
    "key": "cmd+t",
    "command": "workbench.action.files.newUntitledFile",
    "when": "watchExpressionsFocused"
},
{
    "key": "cmd+g",
    "command": "workbench.action.tasks.terminate"
},
{
    "command": "workbench.files.action.collapseExplorerFolders",
    "key": ""
}

]

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions