Skip to content

Use global context when looking up a primary keybinding for a command #126306

@bpringe

Description

@bpringe

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.58.0-insider
  • OS Version: Linux x64 5.10.41-1-MANJARO snap

Steps to Reproduce:

  1. Open command palette (ctrl+shift+p)
  2. See a command with a keybinding for a different OS than the one you're running, indicated next to the command name

If a keybinding is defined with different bindings per OS in the package.json, it seems that only the first one defined is shown to the user in the command palette, rather than showing the correct keybinding for the user's OS. This has caused confusion with an extension I maintain.

With the below keybinding defined in Calva's package.json, it seems only the "mac" shortcut is shown in the command palette, regardless of the user's OS.

{
    "command": "paredit.forwardSexp",
    "mac": "alt+right",
    "win": "ctrl+right",
    "linux": "ctrl+right",
    "when": "calva:keybindingsEnabled && editorLangId == clojure && editorTextFocus && paredit:keyMap =~ /original|strict/ && config.calva.paredit.hijackVSCodeDefaults && !calva:cursorInComment || calva:cursorAfterComment"
}

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsiderskeybindingsVS Code keybinding issuesverification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions