visual-studio-code - Visual Studio Code 集成终端中的 SIGINT

标签 visual-studio-code

在常规的 Windows 终端中,Control+C 键绑定(bind)到 SIGINT,允许您中断正在运行的进程。 Visual Studio Code 的集成终端使您能够通过 terminal.integrated.commandsToSkipShell 传递键命令,这非常有用。虽然 Control+C 是默认复制的键绑定(bind),但 SIGINT 在设置中并不明显,无法为其设置键绑定(bind)。如何将 SIGINT 发送到 Visual Studio Code 集成控制台,最好是对其进行键绑定(bind),以便您可以向进程发出停止或中断信号?

这是我能够找到的文档,不幸的是,它没有提及 SIGINT 或使用 Control+C 进行中断,我认为这是常见的需要:https://code.visualstudio.com/docs/editor/integrated-terminal

最佳答案

事实证明,在 Windows 的 Visual Studio Code 上,ctrl-cctrl-v 等命令被设置为绕过终端并由 VSCode 本身处理.

要修复,只需打开您的首选项File>Preferences>Settings(ctrl-,)并添加您自己的terminal.integrated.commandsToSkipShell 设置值(value)。最好让 VSCode 使用它的 intellisense 功能为你完成工作,这样你就可以获得所有默认设置,这样你就不会意外更改你期望工作的其他行为。

然后继续并移除 workbench.action.terminal.copySelectionctrl-c 工作和 workbench.action.terminal.pastectrl-v 工作。

粘贴到终端仍然适用于 ctrl-shift-v 但我还没有弄清楚如何进行复制。如果我这样做,我会更新这个答案。

关于visual-studio-code - Visual Studio Code 集成终端中的 SIGINT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43667317/

相关文章:

visual-studio-code - 在 Visual Studio Code 中调试 Cypress 测试

visual-studio-code - 如何在 VS Code 中获取当前主题的颜色?

python - 无法从 VS Code 调试 Django 进程

visual-studio-code - 每次保存时自动运行 mypy 和 pylint?

haskell - 无法在 Haskell 中导入模块

Java-VSCode错误:Cannot resolve the modulepaths/classpaths automatically,请在launch.json中指定值

php - Visual Studio Code - 无法在不运行程序的情况下设置环境(或

visual-studio-code - VS Code 滚动 map (小 map )

json - 如何使用对象解构在 TypeScript 中导入 JSON?

visual-studio-code - jsconfig.json 错误 : "node_modules/html-entities/lib/index" not found