Run Multiple Terminals Side by Side in VS Code
Visual Studio Code (VS Code) allows developers to run and manage multiple terminal instances simultaneously within the same panel. This guide provides a straightforward explanation of how to split your terminal screen side-by-side using the graphical interface, keyboard shortcuts, and the command palette, as well as how to navigate and close them efficiently.
Opening the Terminal
First, ensure your terminal panel is visible. You can open it by
going to Terminal > New Terminal in the top menu, or
by using the keyboard shortcut Ctrl + ` (Windows/Linux) or
Cmd + ` (macOS).
Methods to Split the Terminal
Method 1: Using the User Interface Look at the top-right corner of the terminal panel. Click the Split Terminal icon, which looks like a small square split vertically down the middle (located next to the “+” button). This immediately duplicates your current shell session into a side-by-side view.
Method 2: Using Keyboard Shortcuts You can instantly
split the terminal using the default system shortcuts: * Windows
/ Linux: Press Ctrl + Shift + 5 *
macOS: Press Cmd + \ or
Ctrl + Shift + 5
Method 3: Using the Command Palette 1. Open the
Command Palette by pressing Ctrl + Shift + P
(Windows/Linux) or Cmd + Shift + P (macOS). 2. Type
Terminal: Split Terminal. 3. Press Enter.
Navigating Between Terminals
To switch control from one terminal pane to another without using
your mouse: * Windows / Linux: Hold Alt
and use the Left or Right arrow keys. *
macOS: Hold Cmd + Option and use the
Left or Right arrow keys.
Closing a Split Terminal
When you are finished with a specific instance, you can close it by:
* Clicking the Trash Can icon in the terminal tabs list
on the right side of the panel. * Typing exit in the
command line of the active pane and pressing Enter. * Using
the shortcut Ctrl + W (Windows/Linux) or
Cmd + W (macOS) when focused on the pane you want to
close.