微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 VS Code 的集成终端中将 ctrl+f 发送到 shell?

如何解决如何在 VS Code 的集成终端中将 ctrl+f 发送到 shell?

我在 VS Code 的集成终端中使用 fish shell,并希望将组合键 ctrl + f 发送到终端/shell,而不是在终端。我该怎么做?

我浏览了 VS Code 的文档并找到了以下设置,但我不确定如何使用它们来实现我的目标:

find

我不想将 所有 键绑定发送到 shell,除了认值之外,只发送 // dispatches most keybindings to the terminal instead of the workbench,overriding `terminal.integrated.commandsToSkipShell`,which can be used alternatively for fine tuning. "terminal.integrated.sendKeybindingsToShell": false,// A set of command IDs whose keybindings will not be sent to the shell but instead always be handled by VS Code. This allows keybindings that would normally be consumed by the shell to act instead the same as when the terminal is not focused,for example `Ctrl+P` to launch Quick Open. "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",],。这是文档的链接https://code.visualstudio.com/docs/editor/integrated-terminal#_keybindings-and-the-shell。这个答案不是我想要的,因为它彻底改变了认值。我只想要一个小小的改变:https://stackoverflow.com/a/65122041/7483211

解决方法

这有效:

"terminal.integrated.commandsToSkipShell": [
    "-workbench.action.terminal.focusFind"
],

documentation 下面列出的解决方案对我不起作用(我为此打开了一个 issue

// Windows/Linux
{ "key": "ctrl+f","command": "-workbench.action.terminal.focusFind","when": "terminalFocus" },// macOS
{ "key": "cmd+f",

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。