Change default terminal app in Visual Studio Code on Mac

Solution 1:

Here's an example of how to make another terminal the default for VSCode, in this example I've downloaded iTerm2 and copied iTerm2 to Applications.

  1. Code (Menu) > Preferences > User Settings

enter image description here

  1. Edit settings.json "terminal.external.osxExec": "iTerm.app" and "terminal.explorerKind": "external"

enter image description here

  1. Open in Terminal

enter image description here

  1. iTerm is now default terminal launched from VSCode

enter image description here

Solution 2:

For those that want to change the default integrated terminal NOT just the external, and add custom themes, show which git branch you are on, and whether or not files need to be staged or committed for example.

Follow these short steps:

Make sure you have these installed:

iTerm2, oh-my-zsh

Install a powerline font (I am using Menlo which is a nice looking and very popular font).

Go here and click on download

Open the file

Click on install font

(Note: without this, vscode integrated terminal will not render themes correctly)

Open the .zshrc file by running this command:

cd ~ ; code .zshrc

Change iTerm's theme to agnoster:

Press ⌘f to open search in the .zshrc file

Type ZSH_THEME

Search until you find the live code, NOT the commented out code :)

Edit the code it so it looks like ZSH_THEME="agnoster"

Save the file

Open vscode settings using shortcut:

⌘,

Inside of vscode settings, you will see two panels. On the right panel paste this:

"terminal.external.osxExec": "iTerm.app",
"terminal.integrated.shell.osx": "/bin/zsh",
"terminal.integrated.fontFamily": "Menlo for Powerline"

Assuming the settings were empty before, it should now look like this:

{
    "terminal.external.osxExec": "iTerm.app",
    "terminal.integrated.shell.osx": "/bin/zsh",
    "terminal.integrated.fontFamily": "Menlo for Powerline"
}

Finished! Enjoy your new iced out terminal

-(Optional customization)-

If you want your prompt to display something other than your username such as a thunder bolt, like in mine or anything you want

Open agnoster theme by runnning this command:

cd ~/.oh-my-zsh/themes/ ; code agnoster.zsh-theme

Open search by pressing:

⌘f

Paste this in search bar:

prompt_segment black default "%(!.%{%F{yellow}%}.)$USER@%m"

To change your what your prompt displays, edit ONLY this part:

$USER@%m

DO NOT CHANGE this part:

prompt_segment black default "%(!.%{%F{yellow}%}.)

In conclusion, the code should now look something like this:

prompt_segment black default "%(!.%{%F{yellow}%}.) Insert here whatever your heart desires"

(Note: Technically you can change everything about your terminal prompt, but for the sake of keeping this short, and simple we only edited the username part)

Solution 3:

I recently changed my terminal in VSCode to ozh, its just 1 step and 1 line.

  1. Open Command Palette using View > Command Palette ( or simply Command + Shift + P )

  2. add the following line to the user settings.

    "terminal.integrated.shell.osx": "zsh"

enter image description here