Skip to content

Address VSCode issue 45679 - #45995

Closed
Joe Rohde (joerohde) wants to merge 1 commit into
microsoft:masterfrom
joerohde:master
Closed

Joe Rohde (joerohde) wants to merge 1 commit into
microsoft:masterfrom
joerohde:master

Conversation

@joerohde

Copy link
Copy Markdown

#45679

  • Accept mac/linux/win overrides in user keybindings
  • Behave same as extension contributed keys
  • Add tests

 - Accept mac/linux/win overrides in user keybindings
 - Behave same as extension contributed keys
 - Add tests
@msftclas

Microsoft Contribution License Agreements (msftclas) commented Mar 16, 2018 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@alexdima

Alexandru Dima (alexdima) commented Mar 26, 2018 •

Copy link
Copy Markdown
Member

Although this is a working solution to the problem of synchronizing keybindings.json across OSes, my concern is that this change complicates things for the vast number of people that don't need to synchronize keybindings.json via cp across machines with different OSes. i.e. everybody will now be exposed via schema suggestions to win, mac, linux.

Two possible design alternatives:

  • have platform specific files: e.g. keybindings.win.json, keybindings.mac.json that would overwrite a cross-OS shareable keybindings.json. This might be also be equally difficult for regular folks to work with.
  • have os available as a when context key. e.g.
{ "key": "ctrl+f", "command": "editor.action.commentLine", "when": "os==='win'" }

opinions @Microsoft/vscode ?

@bpasero

Copy link
Copy Markdown
Contributor

alexandrudima I actually fine the OS when condition a elegant solution.

@joerohde

Joe Rohde (joerohde) commented Mar 26, 2018 •

Copy link
Copy Markdown
Author

OK. I'll throw a couple thoughts - I do see your point.

  • The 'Keyboard Shortcuts' (unlike settings) does not open the json when used. I think the user base that is going to muck with the json and edit it to where they see the autocomplete can also read the descriptive text (which I certainly could have done better with like saying 'optional' and 'override'). admittedly - I don't interact with the general user base day to day. :)

  • With a json array entry per override with a 'where' it is likely to get cumbersome over time and make it very hard to get a holistic look at what keys are bound to a command). I don't think it makes sense to list the overrides in the Keyboard Shortcuts page, as I do agree - most users won't care.

  • I was hoping to do PLs for the various sync extensions to allow a merging command and config for using a shared keybinding file (as they do bullet 1 above behind the scenes). While not a real consideration for what's the right design, the 'merge' would be awkward at best with a 'when' solution. Doing the OS specific config files would break the sync extensions until they update.

  • This model is already used in the settings (terminal and shell), and launch config. Albeit primarily as 'osx' for the mac.

@bpasero

Copy link
Copy Markdown
Contributor

Duplicate of #54894

@bpasero Benjamin Pasero (bpasero) marked this as a duplicate of #54894 Aug 7, 2018
@alexdima

Copy link
Copy Markdown
Member

PR #54894 adds the context keys that we need.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants