Learning never exhausts the mind
Home >  Coding > Software Engineering > Windows Terminal Power Toolkit

Published 18th July 2020 by

Introducing Windows Terminal - Windows command line for the 21st century. We show you how to customize and extend its use, add backgrounds, profiles, colour schemes, shortcuts and more!

Windows Terminal is a modern, fast, efficient, powerful, and productive terminal application for users of command-line tools and shells like PowerShell, Command Prompt, GIT-Bash and WSL. Get Windows Terminal.

Windows Terminal's main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and custom themes, styles, and configurations.

Windows Terminal running PowerShell

Windows Terminal running PowerShell

Windows Terminal Settings

Windows Terminal is still in an early development stage, although it is stable. As such the settings configuration page is not GUI'd yet - it's a JSON file which you can edit in VS Code.

To get started, simply click on the down arrow in the tabs bar and select settings. This will open up the settings.json file in your default editor.

The settings.json file is as the name suggests a JSON formatted configuration. JSON is an easy to use format for such use, but there are a few rules to be aware of.

  1. Do not use backslash (\) in file paths. These should be replaced with a forward slash (/).
  2. Always close files paths in double quotes.
  3. All lines must end in a comma except for the last line in a section or block.

There are two main sections that are important - profiles and schemes. Profiles has a default section which allows you to enter any setting values that are shared between all profiles. Profiles also has a list of profiles - one for each type of console window - PowerShell and Command Prompt are added as a basic starting point. Schemes section allows you to define a colour pallet which can then be assigned to a profile or profiles.

Let's look at some of the most common settings and start customising Windows Terminal.

Windows Terminal Acrylic Look

Acrylic Look is a semi-transparent window effect with blur, like the Windows Aero effect from Windows 7.

Windows Terminal Acrylic

Windows Terminal Acrylic

Windows Terminal Acrylic Look allows applications or the desktop background to shine through the console window. To get this effect, open the settings.json file and add these two lines to either the defaults or the profile that you wish to have this effect. In this example I added it to the defaults. You can change the strength of the effect by altering the acrylicOpacity value. 1 = no acrylic effect and 0 = full on.

"defaults": {
  // Put settings here that you want to apply to all profiles.
  "useAcrylic": true,
  "acrylicOpacity": 0.5,
},

Windows Terminal Wallpapers

Instead of the Acrylic effect you can add a wallpaper to the Windows Terminal like in the first screenshot. You can use any image you want but I found it best to use dark/muted colours to aid visibility of the text.

As before, you can add these values into settings.json in the default or a profile. I've added to the defaults in this example.

"defaults": {
  // Put settings here that you want to apply to all profiles.
  "backgroundImage": "C:\\Users\\ttrott\\Documents\\Windows Terminal\\vbanner.jpg"
},

This will apply the image to the background of the terminal windows. By default it will stretch to fit the size of the window. You can change that with these settings if you want something different.

"defaults": {
  // Put settings here that you want to apply to all profiles.
  "backgroundImage": "C:\\Users\\ttrott\\Documents\\Windows Terminal\\vbanner.jpg",
  "backgroundImageStretchMode": "none",
  "backgroundImageAlignment": "bottomRight"
},
  • backgroundImageStretchMode accepts values of "none", "fill", "uniform" and "uniformToFill" with uniformToFill being the default.
  • backgroundImageAlignment accepts values of "center", "left", "top", "right", "bottom", "topLeft", "topRight", "bottomLeft" and "bottomRight" with center being the default.

You can use these combinations to have a full wallpaper or a logo / watermark in the corner.

Windows Terminal Colour Schemes

The next cool thing that you can configure are colours! There are several built-in preset schemes, or you can create your own scheme from scratch. Colour schemes are defined in the schemes section of the setting.json and linked to in the default or the profile.

"defaults": {
  // Put settings here that you want to apply to all profiles.
  "colorScheme": "Campbell"
},

The default colour scheme looks like this:

"schemes": [
{
    "name" : "Campbell",
    "cursorColor": "#FFFFFF",
    "selectionBackground": "#FFFFFF",
    "background" : "#0C0C0C",
    "foreground" : "#CCCCCC",
    "black" : "#0C0C0C",
    "blue" : "#0037DA",
    "cyan" : "#3A96DD",
    "green" : "#13A10E",
    "purple" : "#881798",
    "red" : "#C50F1F",
    "white" : "#CCCCCC",
    "yellow" : "#C19C00",
    "brightBlack" : "#767676",
    "brightBlue" : "#3B78FF",
    "brightCyan" : "#61D6D6",
    "brightGreen" : "#16C60C",
    "brightPurple" : "#B4009E",
    "brightRed" : "#E74856",
    "brightWhite" : "#F2F2F2",
    "brightYellow" : "#F9F1A5"
}
]

Every setting, aside from name, accepts a color as a string in hex format: "#rgb" or "#rrggbb". The cursorColor and selectionBackground settings are optional.

The default colour scheme

Windows Terminal Campbell Color Scheme

Windows Terminal Campbell Color Scheme

For more schemes, see the Custom Terminal Gallery section of the Microsoft Documentation.

Windows Terminal Profiles

Windows Terminal provides access to PowerShell, Command Prompt and Azure Cloud Console by default but you can add in any terminal application you have installed, or even run PowerShell scripts, npm watch, Linux bash shells, Git you name it.

To create a new type of terminal is as easy as creating a new profile in the list section. When creating a new profile just use a new random guid. Here are a few examples:

"list": [
  {
    // Make changes here to the powershell.exe profile.
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "name": "Windows PowerShell",
    "commandline": "powershell.exe",
    "hidden": false,
    "backgroundImage": "C:\\Users\\ttrott\\Documents\\Windows Terminal\\windowslight.jpg",
    "colorScheme": "shades-of-purple"
  },
  {
    "guid": "{61ffd275-e15d-4a7d-9f42-ff241ec4e1e3}",
    "name": "Run HUGO",
    "commandline": "C:\\Dev\\Hugo\\website\\..\\hugo server -D",
    "startingDirectory": "C:\\Dev\\Hugo\\website",
    "hidden": false,
    "backgroundImage": "C:\\Users\\ttrott\\Documents\\Windows Terminal\\hugo.png",
    "icon": "C:\\Users\\ttrott\\Documents\\Windows Terminal\\hugo.ico",
    "backgroundImageStretchMode": "none",
    "backgroundImageAlignment": "bottomRight"
  },
  {
    // Make changes here to the cmd.exe profile.
    "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
    "name": "Command Prompt",
    "commandline": "cmd.exe",
    "hidden": false,
    "colorScheme": "Retro",
    "cursorColor": "#FFFFFF",
    "cursorShape": "filledBox",
    "fontSize": 16,
    "padding": "5, 5, 5, 5",
    "fontFace": "PxPlus IBM VGA8",
    "experimental.retroTerminalEffect": true
  },
  {
    "guid": "{3b433b11-c393-47ed-9421-bafebb058f6c}",
    "name": "Git-Bash",
    "tabTitle": "Git-Bash",
    "commandline": "C:\\Program Files\\Git\\bin\\bash.exe",
    "icon": "C:\\Program Files\\Git\\mingw64\\share\\git\\git-for-windows.ico",
    "cursorShape": "filledBox",
    "cursorColor": "#FFFF00",
    "colorScheme": "Slate",
    "startingDirectory": "C:\\Dev\\"
  },
  {
    "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
    "hidden": true,
    "name": "Azure Cloud Shell",
    "source": "Windows.Terminal.Azure"
  }
]

You will need to change folder/paths according to your system but this should get you started.

Windows Terminal Shortcuts

By far the easiest way to launch Windows Terminal is to pin it to the task bar. That way you can easily launch regardless of what apps are open and you don't have to go looking for it. If you right click the Windows Terminal icon a context menu will show all the profiles you have configured so you can launch the specific terminal script right away.

You can also run wt from the command line to launch the Windows Terminal, as wt.exe gets added to the Windows PATH when the Windows Terminal is installed.

You can even launch Windows Terminal with a custom keyboard shortcut. This involves a bit of configuration.

  1. Open Windows Explorer and type shell:AppsFolder into the address bar and hit enter.
  2. Locate the Windows Terminal icon, right click and create shortcut. Save to desktop.
  3. On the desktop, locate the new Windows Terminal Shortcut, right click, properties
  4. On the shortcut tab enter a shortcut combination
Launch Windows Terminal via a custom keyboard shortcutPermalink

Launch Windows Terminal via a custom keyboard shortcutPermalink

Windows Terminal Powerline (Git Awesomeness)

Powerline provides a customized command prompt experience providing Git status color-coding and prompts. There are quite a few steps to get this working, but if you work with Git on a regular basis then it is highly worth the effort to setup.

You need to have Git for Windows installed. You also need to download and install a Powerline font.

Next we need to install Posh-Git, Oh-My-Posh and PSReadLine on a PowerShell prompt.

Install-Module posh-git -Scope CurrentUser
Install-Module oh-my-posh -Scope CurrentUser
Install-Module -Name PSReadLine -Scope CurrentUser -Force -SkipPublisherCheck

Now edit your PowerShell profile and add these lines at the top:

Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Paradox

Now, each new instance starts by importing Posh-Git and Oh-My-Posh, then setting the Paradox theme from Oh-My-Posh. Oh-My-Posh comes with several built-in themes.

Now we just need to alter the PowerShell profile in Windows Terminal Settings to use the new font.

{
  // Make changes here to the powershell.exe profile.
  "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
  "name": "Windows PowerShell",
  "commandline": "powershell.exe",
  "hidden": false,
  "backgroundImage": "C:\\Users\\ttrott\\Documents\\Windows Terminal\\windowslight.jpg",
  "colorScheme": "shades-of-purple",
  "fontFace": "Cascadia Code PL"
},

If you also use the integrated terminal in Visual Studio Code, you should add "terminal.integrated.fontFamily": "Cascadia Code PL" to your Visual Studio Code settings to make sure Powerline works there as well.

Windows Terminal Powerline Powershell

Windows Terminal Powerline Powershell

One thought on “Windows Terminal Power Toolkit
  • 28th March 2021 at 3:13 pm

    Windows Terminal now has a hidden graphical Settings editor

    Microsoft released Windows Terminal Preview v1.5 this week, and it comes with some useful improvements, including full support for clickable hyperlinks, command palette improvements, emoji icon support, and more.

    To open this hidden GUI 'Settings' interface, you need to add a keyboard combination shortcut for the 'openSettings' command like the one listed below. While we chose to use the Ctrl+Shift+S keyboard combination, you can use a different one of your choice.

    { "command": { "action": "openSettings", "target": "settingsUI" }, "keys": "ctrl+shift+s" }

    When you save the settings.json file, Windows Terminal Preview will automatically begin using the changes.

    You can now press the Ctrl+Shift+S keyboard combination to launch a Settings GUI that allows you to configure all the general application settings for Windows Terminal.

    Reply

Leave a Reply

Fields marked with * are mandatory.

We respect your privacy, and will not make your email public. Hashed email address may be checked against Gravatar service to retrieve avatars. This site uses Akismet to reduce spam. Learn how your comment data is processed.