Every time I open the new Windows Terminal, which I am extremely excited about, by default it opens a PowerShell window. As you probably figured, I am no Windows or Help Desk admin (or at least as of 15 years ago, anyways).
Although I do sometimes do have to use PowerShell to enable one Windows feature or another, Ubuntu WSL is where I ply my trade most of my waking hours. So it would make sense that whenever I opened Windows Terminal, it would open a new Ubuntu WSL session.
If you haven’t installed Windows Terminal yet, you can get it from Microsoft’s Window Store (for free). You may or may not need to be running on an edge release of Windows 10.
If you want to contribute to the development of the Windows Terminal, make sure to check out their repository over at Github.
When you open Windows Terminal, open the Settings:
That should open a Notepad.exe window with Windows Terminal settings:
defaultProfile field at the top: it contains a UUID, or unique identifier. As does each entry under the
In my case, the UUID
61c54bbd.. corresponds to the
I am going to change that to
c6eaf9f4–32a7…, which corresponds to my Ubuntu WSL profile:
And just like that, next time I open Windows Terminal for the first time, it should open an Ubuntu WSL session instead of PowerShell.
Customize All The Things
Go do and check out Kayla’s set of of blog entries, as well as the rest of written by Microsoft’s Command Line team to stay updated about new Windows Terminal features and releases!
If you want to personalize the terminal’s background image or opacity, check out How to change the Windows Terminal background image by Thomas Maurer (September 14, 2019).
Here’s my settings:
Regarding changing the background image, there’s two things that I noted:
- I was not able to apply a global background image and transparency setting (for all terminals). Instead, I had to apply it individually to my WSL profiles. That’s OK with, because it works.
- You CAN use Windows environment variables when specifying the path to your custom background image. Provides for a more flexible setup and a less PII-leaky screenshots (pasted below).
Here’s is the end result:
If you’re curious what I’m using for background, it’s from NASA’s image of the day gallery, which supplies with super high resolution images free of us (they’re taxpayer funded, after all):
What if I want to modify the default cmd.exe ?
The default cmd.exe shell is invoked like so by Windows Terminal:
While in the cmd shell, if you type
/? it shows you a list of things that you can do when invoking the shell.
In addition, the
prompt command documentation provides further list of options that you can use to customize your prompt.
By chaining the invocation options provided by cmd.exe with the options provided by
prompt, you can fully customize what is shown in your command prompt when you open it.
In my case using the following setting for the Windows Terminal:
// Make changes here to the cmd.exe profile
"commandline": "cmd.exe /K prompt $email@example.com$s$l3$g$s",
"startingDirectory" : "%USERPROFILE%/Sites",
"useAcrylic" : true,
"acrylicOpacity" : 0.7,
"backgroundImageOpacity" : 0.4
Yields the following result:
/K cmd.exe parameter tells the shell to execute the following command without terminating the shell. And by passing
/K I can fully customize the appearance of my prompt.
No more pesky PII (such as your username) being shown on the prompt when I post screenshots of my prompt on my stories, along with some nice swag to go with it.