json 如何在VS CODE中切换终端选项卡?

t2a7ltrp  于 2023-01-18  发布在  其他
关注(0)|答案(3)|浏览(169)

我想创建键盘快捷键,以便在终端窗口中的选项卡之间切换。我尝试在JSON文件中写入新行,但似乎不起作用。我添加了一张图片来解释我自己。在图片中有2个选项卡在终端中,右侧是绿色和右侧是红色。我想创建一个快捷键,将在2个终端选项卡之间切换,就像我处理编辑器选项卡一样。
terminal pic with 2 tabs in it:
我试着把下面几行代码添加到json文件中:

{
        "key": "ctrl+f2",
        "command": "workbench.action.terminal.nextTab",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+f1",
        "command": "workbench.action.terminal.prevTab",
        "when": "terminalFocus"
    },

但似乎不起作用。编辑:我用Windows。

x6492ojm

x6492ojm1#

您可以在图片中使用alt +右箭头和alt +左箭头在两者之间切换。(上箭头和下箭头也可以使用)

gab6jxml

gab6jxml2#

对于Windows,切换终端只需按ctrl + ~
并切换回代码编辑器ctrl + 1

qnyhuwrf

qnyhuwrf3#

看起来您可以使用alt+downalt+right切换到下一个窗格,使用alt+upalt+left切换到上一个窗格:

{
  "key": "alt+down",
  "command": "workbench.action.terminal.focusNextPane",
  "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
  "key": "alt+right",
  "command": "workbench.action.terminal.focusNextPane",
  "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
  "key": "alt+up",
  "command": "workbench.action.terminal.focusPreviousPane",
  "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
},
{
  "key": "alt+left",
  "command": "workbench.action.terminal.focusPreviousPane",
  "when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported"
}

相关问题