skip to Main Content

I want to create keyboard shortcut in order to switch between tabs in the terminal window. I tried writing new lines in the json file , but it does not seem to work. I added a picture to explain my self. In the picture there 2 tabs in the terminal the right is green and the right is red . I want to create a shortcut that will switch between the 2 terminal tabs ,just as I did with editor tabs .

terminal pic with 2 tabs in it:

I tried adding this lines of code to the json file :

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

but it seems it does not work.
edit: I use windows.

3

Answers


  1. For Windows, to switch terminal you just do ctrl + ~

    and to switch back to code editor ctrl + 1

    Login or Signup to reply.
  2. Seems like you could you use alt+down, alt+right to switch to the next pane and alt+up, alt+left to switch to the previous one:

    {
      "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"
    }
    
    Login or Signup to reply.
  3. You can switch between the two in the picture with alt + rightArrow and alt + leftArrow. (UpArrow and DownArrow also work)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search