Opening Terminal in VS Code
The fastest way to open terminal in VS Code is to press Ctrl+` (that's Ctrl and the backtick key, usually in the top left of your keyboard). On Mac, use Cmd+` instead. A terminal panel will appear at the bottom of your editor window, ready for you to type commands.
If the keyboard shortcut doesn't work, you can open terminal through the menu: click Terminal in the top menu bar, then select New Terminal. This does the same thing as the keyboard shortcut and opens a new terminal session in the panel below your code.
The terminal that opens will be the default shell for your system — PowerShell on Windows, bash or zsh on Mac, and bash on Linux. You can change which shell runs by default, but the default works fine for most tasks when you're starting out.
Key Takeaways
- Press Ctrl+` (or Cmd+` on Mac) to open terminal instantly, or use Terminal menu and select New Terminal.
- The terminal panel appears at the bottom of VS Code and runs your system's default shell without needing to leave the editor.
- You can open multiple terminal tabs by pressing Ctrl+` again or clicking the plus icon in the terminal panel.
- Close a terminal tab by clicking the X next to its name, or type exit and press Enter to close the current session.
- The terminal starts in your project folder by default, so you can run commands on your code immediately.
Opening Multiple Terminals and Switching Between Them
You can open as many terminal tabs as you need. Press Ctrl+` again to open a second terminal, and again for a third. Each one appears as a tab at the bottom of the terminal panel, with a name like "bash" or "PowerShell" and a number.
Click any tab to switch to that terminal. This is useful when you need to run a development server in one terminal and run tests or git commands in another, without stopping the server. Each terminal keeps its own history and state, so switching between them doesn't interrupt what's running.
To close a terminal tab, click the X next to its name. If you want to close all terminals at once, right-click on any tab and select Kill All Terminals. The terminal panel itself closes when you press Ctrl+` again while the terminal is active, or click the X on the panel's top right.
Changing the Default Shell
By default, VS Code uses your system's standard shell. On Windows that's usually PowerShell, on Mac it's usually zsh, and on Linux it's usually bash. If you want to use a different shell — for example, Git Bash on Windows or a different version of bash — you can change it.
Open the Command Palette by pressing Ctrl+Shift+P (Cmd+Shift+P on Mac), then type Terminal: Select Default Profile and press Enter. VS Code will show you a list of shells installed on your computer. Click the one you want to use. From that point on, new terminals will open with that shell instead.
This change only affects new terminals you open after making the choice. Terminals that are already open keep running the old shell. If you change your mind, repeat the same steps and pick a different shell.
Running Commands in Terminal
Once terminal is open, you can type any command your shell understands. Common tasks include running npm start to start a development server, git status to check your repository, python script.py to run a Python file, or ls (on Mac and Linux) or dir (on Windows) to list files in the current folder.
The terminal starts in your project's root folder, so you don't need to navigate there first. If you're working in a subfolder and want to run a command there, you can type cd foldername to move into it, or right-click a folder in the file explorer and select Open in Integrated Terminal to open a terminal in that specific folder.
Press the up arrow key to cycle through your command history — useful when you need to run the same command again. Press Ctrl+C to stop a running command (like a development server). Type exit and press Enter to close the terminal session.
Resizing and Moving the Terminal Panel
The terminal panel takes up space at the bottom of your editor. If you need more room for your code, drag the top edge of the terminal panel upward to make it smaller, or drag it downward to make it larger. You can also hide the terminal entirely by pressing Ctrl+` again, then press it once more to bring it back.
If you prefer the terminal on the side instead of the bottom, right-click the terminal panel's title bar and select Move Panel Right or Move Panel Left. This is useful on wide monitors where you have room to spare horizontally. You can move it back to the bottom the same way.
Troubleshooting Terminal Problems
If terminal doesn't open when you press Ctrl+`, the keyboard shortcut might be taken by another program or VS Code extension. Try opening it through the menu instead: click Terminal at the top, then New Terminal. If that works, the issue is the keyboard shortcut. You can change it by opening the Keyboard Shortcuts editor (Ctrl+K Ctrl+S), searching for "Toggle Integrated Terminal", and setting a new shortcut.
If terminal opens but commands don't work, you might be in the wrong folder. Type pwd (on Mac and Linux) or cd (on Windows) to see where you are, then use cd to navigate to your project folder. If a command like npm or python isn't recognized, that tool isn't installed on your system or isn't in your system's PATH — this is a setup issue outside VS Code itself.
If the terminal shows strange characters or text looks garbled, try closing the terminal and opening a new one. If the problem persists, it might be a shell configuration issue. Try changing to a different default shell and see if that fixes it.
Frequently Asked Questions
Can I open terminal in a specific folder without navigating to it?
Yes. Right-click any folder in the file explorer on the left side of VS Code and select Open in Integrated Terminal. A new terminal opens in that folder, and you can run commands there immediately.
How do I stop a command that's running, like a development server?
Press Ctrl+C. This sends an interrupt signal to the running process and stops it. The terminal prompt returns and you can type a new command. If Ctrl+C doesn't work, try Ctrl+Z, though this is less common.
What's the difference between terminal in VS Code and opening a separate terminal window?
The integrated terminal in VS Code is built into the editor, so you don't have to switch windows. It starts in your project folder automatically and keeps your workspace organized. A separate terminal window works the same way but requires you to navigate and manage a different application.
Can I customize the appearance of terminal, like the font size or colors?
Yes. Open VS Code settings by pressing Ctrl+, (Cmd+, on Mac), search for "terminal", and you'll find options for font size, font family, and color theme. Changes apply immediately to all open terminals.
Why does my terminal show a different shell than I expected?
VS Code uses your system's default shell. On Windows, this is often PowerShell; on Mac, it's often zsh. You can change it by opening the Command Palette (Ctrl+Shift+P), typing Terminal: Select Default Profile, and choosing a different shell from the list.