6. Integrated Terminal Secrets

Constantly switching back and forth between your code editor and a separate command terminal window breaks focus. VS Code features a high-performance **Integrated Terminal Panel** running right below your editors, complete with terminal profiles, split panes, and drag-and-drop operations.

Opening & Toggling the Terminal

You can bring up the terminal tray instantly from your keyboard:

PlatformShortcut Key
Windows / LinuxCtrl + ` (Backtick)
macOSCtrl + ` (Backtick)

Managing Terminal Instances & Splitting Panes

Often, you need multiple terminals active concurrently—for instance, running a local backend node process in one shell while executing git commands in another. VS Code supports multiple terminal workflows:

  • Create New Terminal: Press Ctrl + Shift + ` to add another terminal shell instance. Switch between them using the sidebar drop-down menu inside the terminal panel.
  • Split Terminal Pane: Press Ctrl + \ (or Cmd + \ on macOS) to split the terminal panel vertically. This displays multiple shells side-by-side inside the same horizontal tray! (Shortcut: Ctrl + Shift + 5 on older setups).
  • Maximize Terminal: Need to view long compile outputs? Click the arrow-up icon in the terminal menu (or use the Command Palette command `Toggle Terminal Maximize`) to expand the terminal panel to occupy the entire editor window!

Changing Shell Profiles

Depending on your project requirements, you may need to switch your terminal shell (e.g. from PowerShell or CMD on Windows to Git Bash or WSL Bash, or from bash to zsh on macOS).

  1. Inside the terminal panel, click the **+** button dropdown arrow in the top right menu.
  2. Select **Select Default Profile**.
  3. Choose your preferred shell from the active list. Next time you open a terminal, this shell will load by default!

Dynamic Execution: Sending Code blocks to Terminal

When reading documentation or writing short script modules, copy-pasting code into the terminal manually is repetitive. VS Code allows you to execute selected lines of code instantly:

  1. Highlight any line of code or script block in your editor.
  2. Open the Command Palette (Ctrl + Shift + P).
  3. Search and execute: Terminal: Run Selected Text In Active Terminal.
  4. VS Code will copy the highlighted code, paste it into the open shell, and trigger execution instantly! (Shortcut: bind this to a custom hotkey like Ctrl + Enter).
Pro Tip: You can drag and drop active editor tabs straight into the Terminal panel! Doing this instantly splits the panel and opens a terminal in the folder containing that file, saving you manual cd navigation commands!