, ,

How to Change the Windows Terminal Default Shell Profile

How to Change the Windows Terminal Default Shell Profile

The Windows Terminal is now generally available as version 1.0. I already shared a blog post on how to customize the Windows Terminal and shared my personal settings.json file with a lot of different examples, like the integration of PowerShell Remoting, SSH Remoting, changing the background image and much more. One question I got is, how to change the Windows Terminal default shell or default profile from PowerShell to the Windows Subsystem for Linux (WSL) or the command line (cmd).

By default, the Windows Terminal takes PowerShell 7 (if it is installed) as the primary shell when you open the Windows Terminal. However, if you want to change that you can simply configure the default shell in Windows Terminal, in the settings.json file. On the top, you can find the “defaultProfile” setting with a GUID

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
....
}

The GUID is the GUID of your profile. For example, if you want to change it to cmd, you can use the following GUID “0caa0dad-35be-5f56-a8ff-afceeeaa6101”.

Windows Terminal Default Profile - Default Shell
Windows Terminal settings.json

I hope this blog post gives you a look on how to switch the default shell in Windows Terminal. I recommend that you check out my other blog post where I share even more details on how to customize the Windows Terminal. You can also read the full announcement blog for the version 1.0 here or check out the documentation on Microsoft Docs.

If you have any questions, feel free to leave a comment.

4 responses

  1. IT-Connect Avatar

    Hi Thomas,

    Thank you for this tips. I will try it on my computer but keep PowerShell 7 as default is also a good idea :-)

    Regards,
    Florian

  2. Germán Avatar

    So,
    are there two things playing together, here?

    A terminal and a shell?

    Because the CMD prompt behaves differently whether I use it from within the Windows Terminal or Standalone. In particular, the vanilla standalone CMD does not honor some output text coloring that I am doing; while, it is shown while used from within Windows Terminal.

  3. Chris Avatar
    Chris

    If some of you need to connect to multiple tenants frequently, Windows Terminal in combination with https://www.ucmadscientist.com/bounshell/ is quite powerful.

    Install Bounshell (see link)
    Add a new PowerShell Profile and add this line to settings.json:
    “commandline”: “powershell.exe -noprofile -noexit -command Connect-Bso365Tenant -Tenant 4”,

    By a single click you’re automatically connected to Teams / Exchange Online / Azure AD

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.