Make Ctrl+C=copy and Ctrl+Shift+C=interrupt in VSCode terminal

ⅰ亾dé卋堺 提交于 2020-07-05 06:47:08

问题


I'd like to have Ctrl+C copy and Ctrl+Shift+C send Ctrl+C (interrupt).

I figured out the first half

{
    "key": "ctrl+c",
    "command": "workbench.action.terminal.copySelection",
    "when": "terminalFocus"
}

But how do I do the second half? Is there a command to send an arbitrary key press to the terminal?


回答1:


With Visual Studio Code 1.28.0 there is a command, workbench.action.terminal.sendSequence, to send arbitrary keypresses to the terminal. See Send text from a keybinding to the terminal.

  {
    "key": "ctrl+shift+c",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
      "text": "\u0003"
    },
    "when": "terminalFocus"
  }


来源:https://stackoverflow.com/questions/45257525/make-ctrlc-copy-and-ctrlshiftc-interrupt-in-vscode-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!