Warm tip: This article is reproduced from serverfault.com, please click

How to disable VS Code chords

发布于 2020-12-02 13:17:20

I'm using VS Code 1.51.11 on Mac OS X.

Inside my integrated terminal I want to use the binding CMD+K to trigger the clear command to clear the terminal. It works in my regular Terminal.app, but when I do it in VS Code's integrated terminal I receive the message CMD+K was pressed. Waiting for second key of chord....

I've done research on how to disable chords in VS Code but found no solution in the official documentation or other blog posts on the internet.

I've also checked my key bindings and CMD+K is mapped to this key binding:

  {
    "key": "cmd+k",
    "command": "-workbench.action.terminal.clear",
    "when": "terminalFocus && terminalProcessSupported"
  }

Any help in helping me to actually map CMD + K to the desired functionality (clearing the integrated terminal in VS Code) would be awesome!

Questioner
Richard Jarram
Viewed
0
Mark 2020-12-09 05:34:51

There are two things for you to do. As reported elsewhere disable this setting (enabled is the default):

Terminal > Integrated : Allow Chords

Also, your keybinding

{
  "key": "cmd+k",
  "command": "-workbench.action.terminal.clear",
  "when": "terminalFocus && terminalProcessSupported"
}

has a - before the command. That serves to remove that keybinding and so regardless of the Allow Chords settings, that keybinding would never work. Remove the - to enable the keybinding.