How to Change VSCode’s Default Terminal in 2021

1 minute read

Motivation

Now that I’ve customized my Windows Terminal using the trendy Oh My Zsh and powerlevel10k, I also wanted to change the default terminal on VSCode.

My Windows Terminal

Figure 1. My Windows Terminal

Looks pretty, huh?

Then, I moved to settings on VSCode.

VSCode setting

Figure 2. VSCode setting

But terminal.integrated.shell.windows doesn’t exist. I thought I probably could have done something wrong when installing VSCode. So I just tried typing terminal.integrated.shell.windows into settings.json.

Deprecated feature

Figure 3. Deprecated feature

Then it showed me this message. I read it carefully but I was still confused. I somehow figured out how to change the default terminal in the new way!

The new recommended way

terminal.integrated.profiles.windows

Figure 4. terminal.integrated.profiles.windows

Type terminal.integrated.profiles.windows and open it in settings.json.

settings.json

Figure 5. settings.json

Then, you see this screen (Figure 5).

Add a terminal profile of your choice to terminal.integrated.profiles.windows if it doesn’t already exist:

{
    "terminal.integrated.fontFamily": "MesloLGS NF",
    "terminal.integrated.profiles.windows": {
        "OhMyZsh": {
            "path": "C:\\Windows\\System32\\wsl.exe"
        },
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
        "Command Prompt": {
            "path": [
                "${env:windir}\\Sysnative\\cmd.exe",
                "${env:windir}\\System32\\cmd.exe"
            ],
            "args": [],
            "icon": "terminal-cmd"
        },
        "Git Bash": {
            "source": "Git Bash"
        }
    }
}

I added "OhMyZsh" at the top. The important thing here is that the name of the profile that’ll be set to default shouldn’t have spaces in it. For example, "Oh My Zsh" wouldn’t work, but "OhMyZsh" would.

Then, go back to settings and type terminal.integrated.defaultProfile.windows, and open it in settings.json, which will lead you to this screen (the same screen but with another line at the end):

defaultProfile

Figure 6. defaultProfile line has been added

Then you type the new profile name between the quotation marks and don’t forget to save it!

The end

Figure 7. The end

Ta-da! Now I have a cool terminal on VSCode as well. If the new change doesn’t appear, try restarting VSCode.

Conclusion

This looks very simple but I needed to spend about an hour to figure it out. I hope this helps people who run into the same problem. Thanks for reading!

Leave a comment