【问题标题】:Is there any way to switch windows in VScode via keyboard shortcut when the focus is on the terminal?当焦点在终端上时,有没有办法通过键盘快捷键在 VScode 中切换窗口?
【发布时间】:2020-06-04 16:54:46
【问题描述】:

无论焦点是在编辑器上还是在(任何)终端上,我都想在窗口(vscode)之间切换。我在 json 文件中尝试了下面的键绑定,但没有任何运气。此外,删除 "when" 子句或仅使用 terminalFocus 也不起作用。如果焦点在编辑器上,我似乎只能切换窗口。如有任何建议,将不胜感激。

{
    "key": "ctrl+w",
    "command": "workbench.action.switchWindow",
    "when": "terminalFocus || editorTextFocus"
}

【问题讨论】:

    标签: visual-studio-code keyboard-shortcuts vscode-settings


    【解决方案1】:

    在我的测试中,我看到了两个选项:

    (1) 似乎除了 Ctrl+W 之外的任何其他键绑定都按预期工作;或

    (2) 如果您想使用 Ctrl+W 作为键绑定,请将您的命令 workbench.action.switchWindow 添加到设置中的 Terminal > Integrated: Commands to Skip Shell 列表中。

    【讨论】:

    • 谢谢!另一个键绑定不起作用 (1),但将命令添加到跳过 shell 列表 (2) 就可以了。
    • 太好了,如果答案正确且有用,请不要忘记接受。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 1970-01-01
    • 2012-07-03
    • 1970-01-01
    • 2016-07-01
    • 1970-01-01
    相关资源
    最近更新 更多