Last year Microsoft released a new tool named Windows Terminal for people working in the command line and shell (see the announcement at Microsoft’s DevBlogs). This new tool is meant to replace the traditional command line or cmd in Windows. It is more customizable and can accommodate multiple shells like Command Prompt, PowerShell, and WSL (Windows Subsystem for Linux). This new tool is open source and anyone can contribute to its development. If you want to learn more about the development of Windows Terminal, check out this episode of the Azure DevOps podcast.

In this post, I’m going to cover the basics of installation, feature set, and customization that is possible with Windows Terminal.

Installing Windows Terminal

Windows Terminal is a Windows app available for download from the Windows Store. This is the preferred installation method as it will keep you up-to-date with the latest releases automatically. Installing from the Windows Store requires Windows 10 1903 (build 18292) or later to install.

Alternatively, Terminal can also be manually downloaded from its GitHub repository in its Releases page. If you install Terminal manually, it will require Desktop Bridge VC++v14 Redistributable Package. You will also not receive automatic updates, so when new builds are available, you are responsible for installing them.

Another option, although listed as “unofficial” in the Terminal GitHub repository, is downloading and installing via Chocolately. The package name is “microsoft-windows-terminal” and can be installed and updated using the following commands:

choco install microsoft-windows-terminal
choco upgrade microsoft-windows-terminal

Per-user and profiles settings can be found in the AppData/Local folder for the logged in user:

%LocalAppData%\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe

Windows Terminal Overview

With the application installed, let’s take a quick overview of the console’s layout.

Windows Terminal Showing Tabs, Profiles, and Settings

On first open, it may appear to be like the Command Line or PowerShell console, but at the top you’ll notice the availability of tabs within the window. That’s right, no more dozens of console windows open taking up screen and taskbar real estate. Each tab also does not have to be the same type of console; one tab could be for PowerShell, another for traditional Windows command line, and another for a Linux shell.

To the right of the tabs is a down arrow/caret for accessing Terminal’s menu, which includes access to the default shell profiles, settings, feedback, and about. Some of the default shell profiles include:

  • Windows PowerShell 5.1
  • Command Line (cmd)
  • PowerShell Core
  • Azure Cloud Shell (the CLI version)

Each of these profiles has a shortcut key will open a new tab of that profile and shell. Later in this post I’ll discuss adding your own custom profiles.

Also in this menu is where we can access our Settings for Terminal. Settings for the Terminal are saved in a profiles.json file in a folder named LocalState in the AppData/Local folder mentioned earlier in this article. Selecting Settings will open the file in your default JSON editor.

Zooming in or out within the Terminal tabs is accomplished using Ctrl + and Ctrl –, or holding Ctrl and using the mouse wheel. The Terminal window can be resized like a typical Windows app. Individual tabs can be closed by click the X on their tab, and the entire Terminal can be closed using the X in the upper right corner of the application. By default, Terminal will prompt if you want to close all the tabs when doing so, much like a browser might when trying to close with multiple tabs open. Tabs can also be split horizontally and vertically to create multiple shells within a tab. To split the current tab into a horizontal pane, use the shortcut key ALT SHIFT –, and for a vertical split, use ALT SHIFT +.

Single tab with horizontal and vertical panes

Customize Global Settings

Going back to the menu, clicking on Settings will open a minimal settings file that includes a link to the schema, a GUID for the default profile, a profiles section (including behavior defaults and a list of profiles), and sections for defining custom color schemes or overriding default key bindings for action shortcuts.

The profiles.json file being viewed here is used to define your custom settings. You can change default Terminal behaviors, change your default profile that opens on Terminal load, customize each profile with name, executable, and so on. If you want to view the defaults for Terminal, hold the ALT key while selecting the Settings link back in the Terminal window. This will open defaults.json, which is auto-generated and not saved or found in the program installation directory. This file’s purpose is to show what the default settings currently are, and changes made to this file will not persist. For me, it’s really just a good reference file for seeing what options are available for customizing your Terminal experience.

For example, the default shell profile that loads on application launch is controlled by the defaultProfile setting and is represented by the profile’s GUID. In the code snippet above, the GUID {61c54bbd-c2c6-5271-96e7-009a87ff44bf} represents Windows PowerShell 5.1. If I preferred PowerShell Core to be my default on startup, I would need to copy its profile GUID and replace this value. The defaultProfile setting also controls what shell opens when adding a new tab in the window.

Below the defaultProfile setting is a great place to customize other behavior settings. One of my favorite settings to enable is copyOnSelect. This automatically copies selected text in the Terminal window to the clipboard. Another setting is requestedTheme. This sets a light or dark theme or can default to what the system is using. Here’s what my profiles.json looks like after adding these settings:

I recommend editing the profiles file using VS Code. I’m not sure if it is built-in or a part of some extension I already have installed, but I do have intellisense that helps with what settings are available, what they control, and possible values for the setting. For example, here’s what it looks like when adding the launchMode setting:

To view all the available global settings, check out the documentation here.

Customizing Profiles

The next section in our settings is where the profiles are stored. In here there are two sections: defaults and a list of our profiles. The defaults section allow configuring settings that will apply to each shell profile, allowing for a consistent experience across multiple environments. For example, let’s say I want all my profiles to use the new Cascadia Code font developed by the Windows Terminal and set the font size to 14. Under defaults I’ll add values for fontFace and fontSize:

Other options include configuring the cursor and appearance options like backgrounds, color schemes, and starting directory. For more information on available configuration options, check out the documentation here.

Next is the profiles section, and I feel this is where the real power with Windows Terminal lies. As I mentioned earlier in the post, Windows Terminal can accommodate multiple shell types all in the same window. While I have set the default font type and size for all profiles earlier, I can overwrite this by configuring the same option within the specific profile. For example, I want a more classic look for my Command Line/cmd profile, so I will add fontFace to that profile and set it to Consolas:

Let’s take a look at the Windows PowerShell profile and some of the components that go into making one:

First is the unique identifier or GUID. This doesn’t need to be anything special, and if you want to generate a GUID, use the PowerShell command New-Guid. Next is the name of the profile, this appears in the tab when the profile is opened. This is followed by the commandline setting, which determines what shell or executable is opened when the profile is launched. This could be PowerShell, cmd, Windows Subsystem for Linux (WSL) or any other shell you can install. Take a look at my previous article where I added one for the release candidate version of PowerShell 7:

Add PowerShell 7 Preview Profile to Windows Terminal

Here are some additional blogs that outline adding different types of shells:

How to Add Ubuntu Tab to Windows Terminal in Windows 10

Adding MSL Shell to Windows Terminal

The default and custom profiles have quite a few settings to make each unique, such as assigning a color scheme, setting the background to an image or gif, or setting the icon for its tab.

Schemes

Below the profiles section is the schemes section. This is where we can define custom color schemes and control what the profile window looks like. Each color scheme requires a unique name followed by setting foreground and background colors, then specifying individual colors for black, red, green, yellow, etc. These are some of the color schemes available in by default:

  • Campbell
  • Campbell PowerShell
  • Vintage
  • One Half Dark
  • One Half Light
  • Solarized Dark
  • Solarized Light

People have gotten pretty creative with schemes and setting their profile backgrounds to pictures and gifs, but I’m pretty boring and usually stick with the defaults. However, I was recently working on a custom color scheme for presenting demos and taking screenshots of code examples. I wanted something with a lighter background with darker text so it would appear more distinct (sometimes those red errors messages on dark blue backgrounds are hard to see). I started experimenting with a custom color scheme, and these are what I found for which colors control the different text in PowerShell:

Note: another thing I love about VS Code is the color preview for the hex color codes.

Key Bindings

The Key Bindings section allows for customizing short cut keys and actions inside of the Terminal. When creating a custom key binding, there are three properties in defining a binding:

  1. Command (Required): The command executed by the key binding
  2. Keys (Required): This is the key combination to execute the command
  3. Action (Optional): Ability to add additional functionality to certain commands

Key bindings are structured in one of two ways depending on if the command requires arguments or not:

For commands without arguments:

{ “command”: “commandName”, “keys”: [ “modifiers+key” ] }

For commands with arguments:

{ “command”: { “action”: “commandName”, “argument”: “value” }, “keys”: [“modifiers+key”] }

Modifiers are CTRL+, SHIFT+, and ALT+. These can be combined with just about any other letter, number, symbol, or action key on the keyboard. For a full list of actions and commands check out the documentation here.

For example, I want to override the default key binding for opening a new tab to follow what’s typically found in browser (CTRL + T) as well as add a binding not found in the default for closing a tab (CTRL + W). This is what I would added in the keybindings section:

Summary

Windows Terminal is definitely pretty cool, and I’ve enjoyed using it so far. It feels snappy and quick, and although I’m not much of a customizer, I plan on trying to make some pretty cool looking profiles. I also recently saw something on Twitter where the Windows Terminal team is working on a graphical interface to configuring the settings instead of working in JSON (citation needed, I can’t find the tweet now!). I’m making a guess that it will be similar to VS Code as that tool also started out with customizations occurring in JSON.

Windows Terminal is also open-sourced, so everyone can contribute if you have a feature idea. You can check out their GitHub page here for more information.

Questions or comments? If so, drop me a note below or find me on Twitter or LinkedIn to discuss further.

Leave a Reply