How to switch between terminals in Visual Studio Code?
alt
+ up/down left/right arrows
to switch between splitted terminals.
If alt
unfocuses your terminal and focuses the menu, add this to the settings file
// settings.json
"window.titleBarStyle": "custom",
"window.customMenuBarAltFocus": false
Looking deeply I found it:
{
"key": "shift+cmd+]",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
}
:)
As of Release 1.56.0, there is inbuilt support for switching terminals in VS Code:
New keybindings
The terminal has several new default keybindings this release:
- Move to previous terminal -
Ctrl+PageUp (macOS Cmd+Shift+])
- Move to next terminal -
Ctrl+PageDown (macOS Cmd+shift+[)
- Focus terminal tabs view -
Ctrl+Shift+\ (macOS Cmd+Shift+\)
- Terminal tabs previewAs always, these default keybindings can be removed or custom keybindings can be added via the keybindings system.
Go to File → Preferences → Keyboard Shortcuts or just press Ctrl + k + Ctrl + s.
Then click the icon in upper right corner, it opens keybindings.json
file:
Try adding the following two entries to this file:
{
"key": "ctrl+pagedown",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus"
},
{
"key": "ctrl+pageup",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus"
}
Note: On Mac change ctrl to cmd