Categories Windows Networking

User’s guide to customizing and managing Windows Terminal

In a previous article, we learned a bit about what’s under the hood with Windows Terminal, an open-source program from Microsoft for users of command-line tools and shells like command prompt, PowerShell, and WSL. My colleague Jeffrey Hicks has shown us how to install Windows Terminal and use it for running comments. But now, let’s dig deeper and learn a bit about configuring Windows Terminal so we can use it more efficiently and how we can begin managing it. Jeffery is an IT veteran with almost 30 years of experience, much of it spent as an IT infrastructure consultant specializing in Microsoft server technologies with an emphasis on automation and efficiency. He is a multi-year recipient of the Microsoft MVP Award. He works today as an independent author, teacher, and consultant. Jeff has taught and presented on PowerShell and the benefits of automation to IT pros worldwide. He has authored and co-authored a number of books, writes for numerous online sites and print publications, a Plural sight author, and a frequent speaker at technology conferences and user groups. His latest books are “The PowerShell Practice Primer” and “PowerShell Scripting and Toolmaking.” You can keep up with Jeff on Twitter and on his blog.

Customizing a Windows Terminal configuration

You can customize your new configuration or any other configuration. I’m not going to go into detail about all the possible settings. You’ll see documentation links in the settings.json file that I encourage you to read. You might also take a look at this Microsoft blog. In the meantime, I’m going to customize the new PowerShell 7 configuration, including a background image.

If you are using VS Code, press Ctrl+Space for completion help. Here’s my finished configuration.

{
    // PowerShell 7 no profile
    "guid" :"{ce2e0471-d728-430b-b668-a644451bd811}",
    "name": "PS7 No Profile",
    "commandline": "pwsh -noprofile -nologo",
    "startingDirectory": "C:\\",
    "icon": "ms-appx:///ProfileIcons/pwsh.scale-150.png",
    "backgroundImage": "c:\\wtimages\\moon.jpg",
    "backgroundImageOpacity": 0.5,
    "useAcrylic": true,
    "acrylicOpacity": 0.5,
    "cursorShape": "underscore",
    "fontFace": "Cascadia Mono",
    "fontWeight": "medium",
    "tabTitle": "PS7 Clean"     
}

Not only does Windows Terminal simplify my console needs, it also makes it easy to look at:

By the way, if you can initiate a session or console from a command prompt, you can create a Windows Terminal configuration. For example, I have ssh installed on a Windows 10 virtual machine that I use for testing. It was very easy to create a configuration.

{
    // Win10 VM
    "name" : "Win10",
    "commandline": "ssh.exe win10 -l artd",
    "guid": "{2822a886-a871-4764-a083-38309db21c96}",
    "icon": "D:\\OneDrive\\windowsterminal\\ProfileIcons\\{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.scale-200.png",
    "tabTitle": "Win10.Company.pri",
    "colorScheme": "Campbell Powershell"
}

Or even something like this:

{
    // SQL Server
    "name": "SQLExpress",
    "colorScheme": "Jeff",
    "tabTitle": "SQL",
    "backgroundImage": "D:\\OneDrive\\Pictures\\db.png",
    "backgroundImageAlignment": "topRight",
    "backgroundImageStretchMode": "none",
    "backgroundImageOpacity": 0.5,
    "icon": "D:\\OneDrive\\windowsterminal\\ProfileIcons\\server.ico",
    "useAcrylic": true,
    "acrylicOpacity": 0.25,
    "guid":"{3c3dc991-64bd-4dae-a34f-2df26e366dc7}",
    "commandline": "powershell.exe -nologo -noexit -noprofile -command &{Import-Module SQLPS;Set-Location SQLSERVER:\\SQL\\$env:computername\\sqlexpress }"
}

This session opens the SQL Server PSDrive:

And if you really want to push this idea, take a look at an entry on my blog, where I create a cross-platform remoting session in a Windows Terminal setting:

Limitations

As with any application, especially one still early in its development, there are limitations and problems. If you go to the Issues section of the project’s GitHub repository, you’ll discover a lot of potential “gotchas.” However, I think there are two primary limitations. Or at least, things that might matter to you.

First is the lack of a graphical interface for customizing your Windows Terminal experience. I don’t mind editing a json file, especially using VS Code, which helps autocomplete settings and values. And to be honest, you aren’t likely to spend a lot of time editing settings once you have everything set.

The other issue, and one that I see the most complaints about, is the inability to launch a session with a different elevation level. If you run Windows Terminal as a non-elevated user, i.e., not “Run As Administrator,” you can’t launch a tab elevated as administrator. Because of the way the application is architected, this is impossible. If you launch Windows Terminal as a normal user, all your tabs run as non-admin. Conversely, if you launch as administrator, all your tabs will also run as administrator. You can start as many instances of wt.exe as you want, including a mix of privilege elevation. But I recognize that for some of you, this may be a showstopper.

Management

Until Microsoft adds a management layer, there are several PowerShell projects from the community that you might find useful. These projects will offer commands making it easier to see and change settings from a PowerShell prompt. You can find modules with a command like:

find-module -Tag windowsterminal,terminal

One thing to keep in mind when looking for PowerShell tools, because Windows Terminal is still actively being developed, they are making changes that might break a PowerShell command. Hopefully, the module author will update their code. I suppose the bottom line is to expect some trial and error as you test out different PowerShell modules. One module that I can speak to is WTToolbox.

Install-Module WTToolbox

This module includes commands that are intended to be run from a Windows Terminal session. For best results, restart Windows Terminal after installing the module. The module makes it easy to see your current configuration, check the installed version, backup your settings, and more:

These are all the processes running under Windows Terminal. The green PowerShell process is the process in the current tab. You can learn more about the commands by visiting the project’s GitHub repository.

Next steps

So, what should you do? It would seem to be the first thing is to install it and try it out. I strongly encourage you to read the documentation in the GitHub repository and any links to external content. There’s so much you can do with configurations, custom shells, and even keyboard shortcuts. I didn’t even get into this topic.

Windows Terminal ships with a number of shortcuts, and you can define your own. If you install the WTToolBox module, you can easily discover them.

I used to have PowerShell consoles open daily. Today, Windows Terminal is one of the first things I fire up. This gives me a single tabbed-pane into everything I might need to do throughout the day. In fact, I’m starting to look at Windows Terminal as the default PowerShell terminal.

Certainly, you can expect a bit of a learning curve. But once you build up some muscle memory and have the configurations you need, I think you’ll be glad you made the investment.

Mitch Tulloch

Mitch Tulloch is Senior Editor of both WServerNews and FitITproNews and is a widely recognized expert on Windows Server and cloud technologies. He has written more than a thousand articles and has authored or been series editor for over 50 books for Microsoft Press and other publishers. Mitch has also been a twelve-time recipient of the Microsoft Most Valuable Professional (MVP) award in the technical category of Cloud and Datacenter Management. He currently runs an IT content development business in Winnipeg, Canada.

Share
Published by
Mitch Tulloch

Recent Posts

Azure AD administrative units: A go-to tool for Microsoft 365 administration

Limiting administrative scope is surprisingly difficult in Microsoft 365. Luckily, Azure AD administrative units can…

16 hours ago

Data privacy regulations: Walking safely through the compliance jungle

Can businesses have a sustainable data privacy policy in a world where ever-changing compliance requirements…

21 hours ago

Placing Hyper-V virtual machines on remote storage

We’ve previously showed you how to add a Windows file server to VMM. In this…

4 days ago

Troubleshooting ‘Outlook cannot connect to server’ error

"Outlook cannot connect to server" is a common error that prevents you from sending or…

4 days ago

New Kubernetes management tool GKE Autopilot unveiled

Kubernetes is the go-to tool for container orchestration. But optimizing it for your needs can…

5 days ago

NurseryCam daycare monitor suffers data breach, according to UK media

The UK app NurseryCam appears to have suffered a data breach — after the company…

5 days ago