How to change the default shell in Windows Terminal

Normally, when you open Windows Terminal, PowerShell will launch as the default shell. However, if you want, you can optionally change this default shell to something of your liking, such as Command Prompt or Ubuntu (Linux).

You may not know it, but there is a piece of code in the settings file of Windows Terminal that decides which shell to open first (the default shell). Thus, by customizing this code, you can change the default shell attached to Windows Terminal, including Command Prompt, Ubuntu (Linux) or Azure Cloud Shell.

To get started, open the 'Start' menu, search for 'Windows Terminal' and click on the corresponding application in the results.

How to change the default shell in Windows Terminal Picture 1

Next, click the down arrow icon at the top of the Windows Terminal window, then select 'Settings'.

How to change the default shell in Windows Terminal Picture 2

Windows will ask you with which application you want to open the settings file. You can choose any code (or plain text) editor from the list, but we recommend using Notepad for simplicity. Please click 'Notepad' in the list and press 'OK'.

How to change the default shell in Windows Terminal Picture 3

When the settings file opens in Notepad, scroll to the shell section that you want to set as default. There is a heading at the top of each section that tells what each particular shell is used for.

For example, the section of PowerShell says 'Make changes here to the powershell.exe profile'. Similarly, the section of the Command Prompt says 'Make changes here to the cmd.exe profile'. The part of Ubuntu has the keyword 'Ubuntu' to the right of the 'name'.

Now copy the text next to 'guid' in the shell you want to select. You don't need to copy both the quotes. Just copy the text inside the quotes, as shown below:

How to change the default shell in Windows Terminal Picture 4

Next, you scroll to the top of the settings file and find the 'defaultProfile' text field. Delete the text next to this field and paste the text you copied above here by pressing Ctrl + V.

How to change the default shell in Windows Terminal Picture 5

Now, click File > Save in Notepad to save the changes.

How to change the default shell in Windows Terminal Picture 6

The shell you selected now becomes the default shell in Windows Terminal.

« PREV
NEXT »