更新时间:2025-08-19 GMT+08:00
分享

配置终端快捷键

“终端”视图聚焦时,许多在CodeArts IDE中绑定的快捷键将失效,因为此时触发的快捷键行为将传递到终端本身并由终端处理。“terminal.integrated.commandsToSkipShell”设置定义一个命令列表,用于指定哪些命令在集成终端中执行时会绕过“shell”直接运行。要替代默认值并将相关命令的快捷绑定传给“shell”,可以加“-”字符为前缀的命令。例如,添加“-workbench.action.quickOpen”可以“Ctrl+P”到达“shell”

{
  "terminal.integrated.commandsToSkipShell": [
    // Ensure the toggle sidebar visibility keybinding skips the shell
    "workbench.action.toggleSidebarVisibility",
    // Send quick open's keybinding to the shell
    "-workbench.action.quickOpen",
  ]
}

要覆盖“terminal.integrated.commandsToSkipShell”设置并将键绑定发送到终端,请启用“terminal.integrated.sendKeybindingsToShell”设置

终端中的组合按键

默认情况下,当按下组合按键时,组合按键是最高优先级的,它将始终跳过终端(绕过“terminal.integrated.commandsToSkipShell”设置)转到CodeArts IDE。如果用户希望终端使用“Ctrl+K”(对于bash终端,这将剪切光标之后的行),可以将“terminal.integrated.allowChords”设置禁用:

{
  "terminal.integrated.allowChords": false
}

要覆盖terminal.integrated.commandsToSkipShell并将键绑定发送到shell而不是工作台,请设置terminal.integrated.sendKeybindingsToShell。

相关文档