How to Change the default Terminal in Visual Studio Code

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
4 min

banner

# Table of Contents

  1. How to Change the default Terminal in Visual Studio Code
  2. Changing the default terminal with the Launch Profile icon
  3. Switching between shells in VS Code by issuing a command
  4. Changing your default terminal within the Settings UI

# How to Change the default Terminal in Visual Studio Code

To change the default terminal in VS Code:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type terminal select default and click on the Terminal: Select Default Profile command.

terminal select default profile

  1. Select your preferred shell from the list, e.g. Git Bash or PowerShell.

select preferred shell from the list

Here is a screenshot of what the options look like on macOS and Linux.

change default terminal macos linux

In my case, I can pick between bash, zsh and tmux.

After you make the selection, close your terminal by clicking on the trash bin icon at the top right corner.

close terminal instance

You can also use the Command Palette to open your new default terminal.

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type toggle terminal and select View: Toggle Terminal.

vscode open terminal

For example, I've selected Power Shell as my default shell.

open default shell

The same approach can be used to select Git Bash as your default shell.

set git bash as default shell

When you use this approach, you always have to completely close the terminal by clicking on the trash bin icon and reopening it for the changes to apply.

# Changing the default terminal with the Launch Profile icon

An alternative approach is to use the Launch Profile icon next to the name of the currently active terminal.

click launch profile icon

Click on Select Default Profile after clicking on the arrow that points downwards.

click select default profile

Then select your preferred shell from the list.

select preferred shell

Even when using this approach, you will most likely have to close the terminal by clicking on the trash bin icon and reopening it to see the changes applied.

# Switching between shells in VS Code by issuing a command

You can also issue a command directly in your terminal to switch between different shells.

Here are some examples of commands.

  • cmd - switch to Command Prompt.
  • powershell - switch to Power Shell.
  • bash - switch to bash or Git Bash (depending on your operating system).
  • node - start the Node.js interpreter.
  • python - start the Python interpreter.
  • py - start the Python interpreter (Windows-specific).
  • python3 - start the Python interpreter (macOS and Linux specific).

switch shells directly in vscode terminal

You can issue these commands directly in your active terminal session.

# Changing your default terminal within the Settings UI

You can also use the settings UI to set your default terminal.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing Ctrl + , on Windows and Linux or Cmd + , on macOS.

  1. Search for terminal default profile.

terminal select default profile in settings

You will see 3 available settings:

  • Terminal › Integrated › Default Profile: Windows - the default shell used on Windows.
  • Terminal › Integrated › Default Profile: Osx - the default shell used on macOS.
  • Terminal › Integrated › Default Profile: Linux - the default shell used on Linux.

Click on the dropdown icon that applies to you and select your preferred shell.

select preferred shell within settings

By default, the setting is set to null.

This means that VS Code automatically tries to detect the default shell that is used.

After you make the selection, close your terminal by clicking on the trash bin icon at the top right corner.

close terminal instance

Then reopen the terminal and the change will be applied.

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.