# Keybinding issue since v1.6.29

**URL:** https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550
**Category:** VS Code
**Created:** [August 9, 2022, 7:34pm UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550 "2022-08-09T19:34:10Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MiguelAlonso](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miguelalonso/32/32151_2.png) [@MiguelAlonso](https://discourse.julialang.org/u/MiguelAlonso)
#### Post date: [August 9, 2022, 7:34pm UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550/1 "2022-08-09T19:34:10Z")

</div>

Hi,

I’ve run into a weird behavior after updating to v1.6.30: I can’t change or delete the extension’s default binding of “Execute Code in REPL” (Ctrl+Enter). If I try to set a new binding, it is added to the default one instead of changing it.

This is frustrating, because it masks VS Code’s shortcut for inserting a new line. I had to roll back to v1.6.28 (the issue also seems to occur in v1.6.29).

Anyone else is experiencing this?

---

<div class="post-metadata">

### Author: ![piechologist](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/piechologist/32/27662_2.png) [@piechologist](https://discourse.julialang.org/u/piechologist)
#### Post date: [August 9, 2022, 8:33pm UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550/2 "2022-08-09T20:33:56Z")

</div>

Yes, there are some more bindings behaving this way, e.g., `Change Current Environment`. I’m on v1.6.30, BTW.

I assume the _when clauses_ with the condition `editorLangId in 'julia.supportedLanguageIds'"` cause this behavior. Can anybody confirm that it should be `editorLangId == 'julia.supportedLanguageIds'"` (swapping the `in` for the `==` operator)?

EDIT:

There may be a workaround: just comment out the when clause in your user `keybindings.json` like:

```julia
    {
        "key": "ctrl+enter",
        "command": "-language-julia.executeCodeBlockOrSelection",
        // "when": "editorTextFocus && activeEditor != 'workbench.editor.notebook' && editorLangId in 'julia.supportedLanguageIds'"
    },

```

I’m not that familiar with VS Code’s inner workings so, I hope somebody else can provide a better solution.

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [August 9, 2022, 9:45pm UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550/3 "2022-08-09T21:45:46Z")

</div>

> [@piechologist](#):
>
> Can anybody confirm that it should be `editorLangId == 'julia.supportedLanguageIds'"` (swapping the `in` for the `==` operator)?

No, that should be `in` – `julia.supportedLanguageIds` is an array.

Your workaround seems correct to me, but I do think there’s a VS Code bug here. Will investigate this tomorrow.

---

<div class="post-metadata">

### Author: ![MiguelAlonso](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/miguelalonso/32/32151_2.png) [@MiguelAlonso](https://discourse.julialang.org/u/MiguelAlonso)
#### Post date: [August 10, 2022, 9:15am UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550/4 "2022-08-10T09:15:17Z")

</div>

Thanks, this fixes it while the issue is ironed out.

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [August 10, 2022, 9:57am UTC](https://discourse.julialang.org/t/keybinding-issue-since-v1-6-29/85550/5 "2022-08-10T09:57:41Z")

</div>

Ok, seems like this issue is specific to the single quotes around `julia.supportedLanguageIds`.

```julia
    {
        "key": "ctrl+enter",
        "command": "-language-julia.executeCodeBlockOrSelection",
        "when": "editorTextFocus && activeEditor != 'workbench.editor.notebook' && editorLangId in julia.supportedLanguageIds"
    }

```

works fine for me.

Upstream issue:

> <https://github.com/microsoft/vscode/issues/157751>
>
> Does this issue occur when all extensions are disabled?: Probably, but hard to r…eproduce
> 
> 
> 
> \- VS Code Version: 1.70.0 and insiders
> \- OS Version: Linux x64 5.18.16-1-MANJARO
> 
> Steps to Reproduce:
> 
> 1. Install an extension that contributes a keybinding with a \`when\` clause containing an \`foo in extension.bar\` check (e.g. the Julia extension).
> 2. Go to the Keyboard Shortcuts UI via \`workbench.action.openGlobalKeybindings\`
> 3. Right click -\> remove the keybinding.
> 4. VS Code tries to remove the keybinding by inserting a new one into the \`User/keybindings.json\`, where the command is prefixed with a minus and, crucially, all complex context keys are quoted:
> \`\`\`
> \[
> {
> "key": "ctrl+enter",
> "command": "-extension.my-command",
> "when": "foo in 'extension.bar'"
> }
> \]
> \`\`\`
> 5. This doesn't actually remove the keybinding from the UI or prevent VS Code from resolving it.
> 6. Remove the single quotes around \`'extension.bar'\`
> 7. The keybinding is properly removed from the UI and cannot be used anymore, as expected.
> 
> As far as I can tell, this behaviour is specific to \`in\` clauses; it's also hard to repro this without an extension because user-supplied keybindings are just removed outright from keybindings.json instead of adding an additional negated entry.
> 
> !\[Peek 2022-08-10 11-53\](https://user-images.githubusercontent.com/6735977/183872750-e4118c6e-5c95-442f-8a63-2c3441175b9c.gif)
