您不能使用内置的 VS Code 键绑定功能来执行此操作。
但是你能如果您使用扩展名,请执行此操作。一个这样的扩展是the multi-command extension。它可能看起来像这样:
{
"key": "ctrl+b",
"command": "extension.multiCommand.execute",
"args": {
"sequence": [
{
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "CUT !!" }
},
// TODO add your other commands. Ex.
// "cursorDown"
]
},
"args": {"text": "u0003"},
"when": "terminalFocus && !terminalTextSelected"
}
您可以在此处获取有关如何使用扩展程序的信息:https://github.com/ryuta46/vscode-multi-command#multi-command-readme。该扩展还有一些其他有趣的功能,我不会在这里详细介绍(因为它们不直接相关)。