How to Change the Default Terminal in Visual Studio Code

Visual Studio Code (VS Code) is arguably the most popular code editor in the world, largely due to its incredibly powerful integrated terminal. By default, when you press Ctrl + ` to open a new terminal window, VS Code launches the default shell of your operating system. On Windows, this is typically PowerShell or Command Prompt. On macOS and Linux, it is usually Zsh or Bash.

However, many developers prefer to use a different command-line interface. For example, a Windows user might want to use Git Bash for Linux-style commands, while a Mac user might prefer the older Bash shell over Zsh. Fortunately, changing the default integrated terminal in VS Code is a very simple process that only takes a few seconds.

Method 1: Using the Command Palette (The Quickest Way)

The easiest way to switch your default terminal is by using the VS Code Command Palette, which allows you to search for settings without clicking through endless menus.

  1. Open Visual Studio Code.
  2. Press Ctrl + Shift + P (on Windows/Linux) or Cmd + Shift + P (on Mac) to open the Command Palette.
  3. Type Terminal: Select Default Profile into the search bar.
  4. Click on the matching result that appears.
  5. A dropdown list will populate with all the compatible shells currently installed on your computer (for example, Command Prompt, PowerShell, Git Bash, or Ubuntu WSL on Windows).
  6. Select your preferred terminal from the list.

To verify the change, click the trash can icon in your current terminal panel to kill it, and then open a new terminal by pressing Ctrl + `. It should immediately launch using your newly selected shell.

Method 2: Using the Terminal Dropdown Menu

If you already have a terminal window open, you can switch profiles directly from the terminal panel itself.

  1. Look at the top right corner of the terminal panel in VS Code.
  2. You will see a small + (plus) icon with a downward-pointing arrow next to it.
  3. Click the downward arrow (not the plus icon itself).
  4. Select Select Default Profile from the bottom of the dropdown menu.
  5. Choose your desired shell from the list that appears at the top of the screen.

Note that clicking a shell from the first part of this dropdown menu only launches a temporary instance of that shell. You must select Select Default Profile to make a permanent change.

Method 3: Editing the settings.json File (For Advanced Users)

If you are managing your VS Code configuration across multiple machines, you might prefer to hardcode your terminal preference directly into the settings.json file.

  1. Open the Command Palette (Ctrl + Shift + P or Cmd + Shift + P).
  2. Type Preferences: Open User Settings (JSON) and hit Enter.
  3. Scroll to the bottom of the JSON file.
  4. To set Git Bash as the default on Windows, for example, you would add the following line just before the final closing brace: "terminal.integrated.defaultProfile.windows": "Git Bash"
  5. If you are on a Mac and want to use Bash, you would add: "terminal.integrated.defaultProfile.osx": "bash"
  6. Save the file. The changes will take effect immediately.

By customising your integrated terminal, you can ensure your development environment exactly matches your command-line workflow, saving you from having to switch between multiple external windows.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.