How to Open and Use the Integrated Terminal in VS Code

Open the integrated terminal in VS Code without leaving the editor. Run shell commands, manage multiple terminals, navigate output, and use Copilot inline chat right inside the terminal panel.

6 min read

The integrated terminal in VS Code runs a full shell inside the editor window. You do not need to switch to a separate terminal application to run commands. It opens at the root of your workspace and supports PowerShell, Command Prompt, Git Bash, zsh, bash, fish, and any other shell installed on your machine.

Once you are comfortable with the basics, learn how to /vscode/how-to-change-the-default-terminal-in-vs-code and /vscode/how-to-split-terminals-and-run-multiple-terminals-in-vs-code.

Open the terminal

There are four ways to open the integrated terminal:

MethodAction
Keyboard shortcutPress Ctrl+` (Windows/Linux) or Cmd+` (macOS). This toggles the terminal panel open and closed.
Menu barSelect Terminal > New Terminal.
Command PalettePress Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS), type View: Toggle Terminal, and press Enter.
Explorer context menuRight-click any folder in the File Explorer and select Open in Integrated Terminal.

The terminal opens as a panel at the bottom of the window. If no workspace folder is open, it starts in your home directory.

If the terminal panel does not appear, the workspace might be in Restricted Mode. Check the status bar for a "Restricted Mode" indicator. You can trust the workspace to enable the terminal, or learn more about Workspace Trust and Restricted Mode.

Create and manage terminal instances

You can run multiple terminal sessions at the same time. Each session appears as a tab on the right side of the terminal panel.

Create a new terminal instance

Click the + button in the top-right corner of the terminal panel, or press Ctrl+Shift+` (Windows/Linux) or Cmd+Shift+` (macOS).

Switch between terminals

Click any tab to bring that terminal to the front. The active terminal tab is highlighted. You can also use the profile dropdown next to the + button to launch a terminal with a specific shell.

Close a terminal

Hover over the tab and click the Trash Can icon, or select the tab and press Delete. You can also run the Terminal: Kill the Active Terminal Instance command from the Command Palette.

Terminal tabs can be reordered by dragging them. You can also drag a tab into the editor area to turn it into a terminal editor that sits alongside your code files.

Run commands and see output

Type any shell command and press Enter. The terminal runs it just like a standalone terminal application. Some things to know:

  • The working directory starts at your workspace root. Change it with cd like normal.
  • Output scrolls up into the scrollback buffer. The buffer keeps 1000 lines by default, controlled by the terminal.integrated.scrollback setting. Scroll with your mouse wheel, trackpad, or the scroll bar.

To run a file or selection from the editor without copying it manually: select text in an editor, open the Command Palette, and run Terminal: Run Selected Text in Active Terminal. If nothing is selected, the entire line where your cursor sits is sent to the terminal.

Use the terminal find tool

Press Ctrl+F (Windows/Linux) or Cmd+F (macOS) while the terminal is focused to open the find widget. Type your search term and matches are highlighted inline in the terminal buffer. Use Enter and Shift+Enter to jump between matches, just like find in the editor.

If you need Ctrl+F to reach the shell instead (for example, in a terminal-based text editor), remove workbench.action.terminal.focusFind from the terminal.integrated.commandsToSkipShell setting.

Copy, paste, and select text

Copy and paste shortcuts follow your platform conventions:

PlatformCopyPaste
WindowsCtrl+CCtrl+V
macOSCmd+CCmd+V
LinuxCtrl+Shift+CCtrl+Shift+V (or Shift+Insert)

You can also enable copy on selection: open Settings, search for terminal.integrated.copyOnSelection, and check the box. Any text you highlight in the terminal will be copied automatically.

To select all text in the terminal, use Cmd+A on macOS or run the Terminal: Select All command on Windows and Linux.

ActionWindowsmacOSLinux
Scroll up one lineCtrl+Alt+PageUpCmd+Option+PageUpCtrl+Shift+Up
Scroll down one lineCtrl+Alt+PageDownCmd+Option+PageDownCtrl+Shift+Down
Scroll up one pageShift+PageUpPageUpShift+PageUp
Scroll down one pageShift+PageDownPageDownShift+PageDown
Jump to topCtrl+HomeCmd+HomeShift+Home
Jump to bottomCtrl+EndCmd+EndShift+End

The terminal detects URLs, file paths, and folder paths automatically. Hover over any link to see an underline, then hold Ctrl (Windows/Linux) or Cmd (macOS) and click it. URLs open in your browser. File paths like src/app.ts:10:5 open the file at the specified line and column.

You can also drag a file from the Explorer into the terminal to paste its escaped path at the cursor.

Maximize the terminal temporarily

When you need to focus entirely on terminal output, click the Maximize Panel Size chevron button in the top-right of the terminal panel, or run View: Toggle Maximized Panel from the Command Palette. This hides the editor area and expands the terminal to fill the window. Click the button again to restore the editor.

The Maximize Panel Size button only appears when the panel alignment is set to Center (the default). If you do not see it, right-click the panel's title bar and confirm the alignment option is set to Center.

Use Copilot in the terminal

If you have GitHub Copilot, you can get AI help directly in the terminal without leaving the command line.

Press Ctrl+I (Windows/Linux) or Cmd+I (macOS) while the terminal is focused to open Terminal Inline Chat. Type a natural-language request and Copilot suggests a command.

Select Run to execute it immediately or Insert to add it to the terminal for editing before running.

You can also use the @terminal chat participant in the Chat view to ask about shell commands and scripting. Learn more about setting up GitHub Copilot Free.

What to do if the terminal does not work

If the terminal fails to open, try these checks in order.

Check for shortcut conflicts

Run Developer: Toggle Keyboard Shortcuts Troubleshooting from the Command Palette to identify a conflicting shortcut.

Clear a stuck terminal

If the panel shows an error, run Terminal: Clear to reset the buffer.

Fix rendering glitches

For a blank area or visual glitches, set terminal.integrated.gpuAcceleration to off. This falls back to DOM rendering.

Check for a macOS startup ding

A ding sound on startup usually means a shell profile script printed unexpected output. Check ~/.zshrc or ~/.bash_profile for stray echo commands.

Rune AI

Rune AI

Key Insights

  • Open the terminal with Ctrl+ (Cmd+ on macOS) or Terminal > New Terminal.
  • Create new terminal instances with the + button or Ctrl+Shift+`.
  • Switch between tabs by clicking them or using the terminal dropdown.
  • Use Ctrl+F (Cmd+F) to find text inside the terminal buffer.
  • Use Terminal: Run Selected Text in Active Terminal to execute editor selections.
  • Try Copilot inline chat with Ctrl+I (Cmd+I) when the terminal is focused.
RunePowered by Rune AI

Frequently Asked Questions

How do I open the terminal if the keyboard shortcut does not work?

Use the menu bar: select Terminal > New Terminal, or open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P) and run View: Toggle Terminal. If the Terminal menu is missing, make sure you are not in Restricted Mode, which blocks terminal access in untrusted workspaces.

Can I run multiple terminal instances at once?

Yes. Click the + button in the terminal panel header or use Ctrl+Shift+` (Cmd+Shift+` on macOS) to create another terminal instance. Each instance appears as a separate tab on the right side of the terminal view.

How do I copy and paste in the VS Code terminal?

On Linux use Ctrl+Shift+C to copy and Ctrl+Shift+V to paste. On macOS use Cmd+C and Cmd+V. On Windows use Ctrl+C and Ctrl+V. You can also enable copy on selection with the terminal.integrated.copyOnSelection setting.

Conclusion

The integrated terminal lets you run shell commands without switching windows. Open it with Ctrl+`, create as many terminals as you need, and use find, copy, paste, and Copilot inline chat to stay productive without leaving the editor.