这是我的方法,它提供了在活动终端之间导航以及在终端和编辑器窗格之间跳转的一致方式无需关闭终端视图。您可以尝试将其直接添加到您的keybindings.json,但我建议您通过键绑定 UI(Mac 上为cmd+K cmd+S),以便查看/管理冲突等。
有了这个,我可以使用ctrl+x <arrow direction> 导航到任何可见的编辑器或终端。光标位于终端部分后,您可以使用 ctrl+x ctrl+up 或 ctrl+x ctrl+down 循环浏览活动终端。
cmd-J 仍用于隐藏/显示终端窗格。
{
"key": "ctrl+x right",
"command": "workbench.action.terminal.focusNextPane",
"when": "terminalFocus"
},
{
"key": "ctrl+x left",
"command": "workbench.action.terminal.focusPreviousPane",
"when": "terminalFocus"
},
{
"key": "ctrl+x ctrl+down",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "ctrl+x ctrl+up",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
},
{
"key": "ctrl+x up",
"command": "workbench.action.navigateUp"
},
{
"key": "ctrl+x down",
"command": "workbench.action.navigateDown"
},
{
"key": "ctrl+x left",
"command": "workbench.action.navigateLeft",
"when": "!terminalFocus"
},
{
"key": "ctrl+x right",
"command": "workbench.action.navigateRight",
"when": "!terminalFocus"
},