How to Split Terminals and Run Multiple Terminals in VS Code

Split the VS Code terminal into side-by-side panes and run multiple shells at once. Create terminal groups, navigate between panes, and manage split layouts.

4 min read

VS Code lets you split a terminal into side-by-side panes, forming a terminal group. You can run a dev server in one pane while using another for git commands, or monitor logs on the left while typing commands on the right.

If you have not used the integrated terminal yet, start with /vscode/how-to-open-and-use-the-integrated-terminal-in-vs-code. Each split pane can run a different shell; set that up with /vscode/how-to-create-and-configure-terminal-profiles-in-vs-code.

Split a terminal

There are three ways to split a terminal:

MethodHow to do it
Keyboard shortcutWith the terminal focused, press Ctrl+Shift+5 (Windows/Linux) or Cmd+\ (macOS).
Inline split buttonHover over a terminal entry in the tab list on the right. Click the split icon that appears.
Right-click menuRight-click a terminal tab and select Split.
Alt+clickHold Alt (Windows/Linux) or Option (macOS) and click the + button or any terminal tab.

Each split creates a new terminal instance in the same group. The new pane appears to the right of the current one. Both terminals run independently: you can type in either one without affecting the other.

Once you have two or more panes, you can move focus between them.

ActionWindows/LinuxmacOS
Focus next paneAlt+RightCmd+Option+Right
Focus previous paneAlt+LeftCmd+Option+Left

Clicking inside a pane also focuses it. The focused pane is highlighted.

If you prefer to use the keyboard to cycle through terminal groups (not just panes within the same group), use Ctrl+PageDown and Ctrl+PageUp (macOS: Cmd+Shift+] and Cmd+Shift+[).

Control the working directory of split terminals

By default, the working directory for a split terminal depends on your platform and configuration.

PlatformDefault behavior
macOS and LinuxThe split terminal inherits the parent terminal's current working directory.
WindowsThe split terminal starts from the directory the parent terminal was opened in, not its current directory.

You can override this with the terminal.integrated.splitCwd setting:

jsonjson
{
  "terminal.integrated.splitCwd": "workspaceRoot"
}

Available values:

  • "inherited": Use the parent terminal's current working directory (macOS/Linux default).
  • "initial": Use the parent terminal's initial working directory (Windows default).
  • "workspaceRoot": Always open at the workspace root folder.

Manage terminal groups

A group is any collection of split terminals that share the same tab entry.

Rearrange tabs: Drag any terminal tab in the list to reorder it. Drag a tab into the main terminal area to move it from one group into another.

Resize panes: Drag the border between split panes to resize them.

Unsplit a terminal: Right-click a terminal tab and select Unsplit Terminal, or run the Terminal: Unsplit Terminal command. The terminal moves out of the group into its own tab.

Close a pane: Select the pane and press Delete (Windows/Linux) or Cmd+Backspace (macOS, with Delete also bound as a secondary shortcut), or hover over its tab entry and click the Trash Can. Closing a pane in a group does not close the other panes.

Open terminals in the editor area

Terminal groups also work in the editor area. This is useful when you want terminals next to your code instead of below it.

To move a terminal to the editor area, drag its tab from the terminal panel into the editor area. You can also run the Terminal: Create New Terminal in Editor Area command from the Command Palette.

In the editor area, you can split and arrange terminal editors just like regular editor tabs. For example, you could have a file editor on the left, a terminal on the right, and a terminal below. Each editor area terminal supports its own splits and groups.

Resize panes and the macOS ding sound

On macOS, the default shortcuts for resizing split terminal panes (Cmd+Ctrl+Left, Right, Up, and Down) can trigger a system "invalid key" ding sound. This is a long-standing Chromium and Electron limitation, not a VS Code bug, and it is harmless but distracting.

The simplest fix is to change the resize shortcuts inside VS Code instead of the mouse-drag method described above. Open the Command Palette and run Preferences: Open Keyboard Shortcuts, search for workbench.action.terminal.resizePane, and assign a different key combination to each direction.

Some online fixes suggest creating a ~/Library/KeyBindings/DefaultKeyBinding.dict file to silence the sound. That file applies system-wide to every macOS application, not just VS Code, so it is not a VS Code-scoped fix. Prefer rebinding the shortcuts in VS Code first, and only edit system-wide key bindings if you understand that broader effect.

Rune AI

Rune AI

Key Insights

  • Split a terminal with Ctrl+Shift+5 (Cmd+\ on macOS) or the inline split button.
  • Alt+click the + button or a terminal tab to split without using the keyboard.
  • Navigate between split panes with Alt+Left (Ctrl+Option+Left on macOS) and Alt+Right.
  • Drag terminal tabs between groups to reorganize your layout.
  • Use Unsplit Terminal to move a terminal out of a group and back into its own tab.
RunePowered by Rune AI

Frequently Asked Questions

How do I unsplit a terminal and move it back to its own tab?

Right-click the terminal tab or the split pane and select Unsplit Terminal, or run the Terminal: Unsplit Terminal command from the Command Palette. The terminal moves out of the group into its own tab.

Can I split the same terminal more than twice?

Yes. You can continue splitting panes within a group to create a grid layout. Each split creates another pane in the same group, and you can split vertically or horizontally depending on where you click.

Why does the split terminal open in a different directory?

The terminal.integrated.splitCwd setting controls this. On macOS and Linux it defaults to `inherited`, meaning the split terminal inherits the parent's working directory. On Windows it starts from the parent's initial directory. Change it to `workspaceRoot` or `initial` if needed.

Conclusion

Split terminals let you watch logs in one pane while running commands in another, all inside the same VS Code window. Split with Ctrl+Shift+5, navigate panes with Alt+Left and Alt+Right, and unsplit when you are done.