- Instant help with your Developer coding problems

Switch between terminal and editor in VS Code

Question:
How to switch between terminal and editor in VS Code?
Answer:
CTRL + J

// Or in keybindings.json
{
    "key":     "ctrl+`",
    "command": "workbench.action.terminal.focus"
},
{
    "key":     "ctrl+`",
    "command": "workbench.action.focusActiveEditorGroup",
    "when":    "terminalFocus"
}
Description:

Using the CTRL + J keyboard shortcut you can activate and deactivate the integrated terminal in VS Code. If the terminal is activated then it automatically got the focus and when deactivating it then the code editor gets the focus back. This solution has a drawback, that each time the terminal panel opens and closes.

If you want the terminal always open you need to manually edit the keybindings.json file and insert the following code:

{
    "key":     "ctrl+`",
    "command": "workbench.action.terminal.focus"
},
{
    "key":     "ctrl+`",
    "command": "workbench.action.focusActiveEditorGroup",
    "when":    "terminalFocus"
}
Share "How to switch between terminal and editor in VS Code?"