Installing the brand new Windows Terminal

Installing the brand new Windows Terminal

You might have used the windows command prompt a lot of times. Well, for those who were unaware, there is a brand new Windows Terminal released recently.

In this article, let’s see what this Windows Terminal is, why would somebody use it and how to install / customize it.

What is Windows Terminal ?

As per documentation, Windows Terminal is a modern terminal application for the users who use the command line tools like Command Prompt, PowerShell and WSL.

Note the word Modern. This is like a command prompt, but a modern command prompt. It supports multiple tabs. It supports multiple panes. It also supports unicode encoding.

Being a modern terminal, it also supports GPU accelerated text rendering engine.

In addition, it also has support for customizing the look and feel of the terminal. You can create your own themes and customize text, colors, backgrounds, and shortcut key bindings.

Why ?

If you want to read complete history and reasoning about why Windows Terminal project was started and why it was required, I would suggest to go through the 5 part blog series by Rich Turner. Below part is summary from those articles, which I thought was more relevant to the topic.

The MS-DOS (command.com) was a relatively simple command line tool. Later, Windows NT’s  “Command Prompt” (cmd.exe) was created to enable users to run the batch scripts and other several commands through command line interface.

In 2006, Microsoft released Windows PowerShell, which was relatively modern object based command line tool, compatible with .NET framework.

Later, Microsoft also started on Windows Subsystem for Linux to enable running of Linux binaries side by side on Windows 10 and Windows Server 2019, without need of recompiling them or without need of dual boot setup.

Early in Windows 10’s development, Microsoft opened up a UserVoice page, asking the community what features they wanted in various areas of the OS. The developer community was particularly vociferous in its requests that Microsoft:

  • Make major improvements to the Windows Console
  • Give users the ability to run Linux tools on Windows

After this, Microsoft focused on adding these abilities on Windows platform and the result is WSL and Windows Terminal.

Installing

If you go to the Microsoft Store and search for terminal word, you should be able to view the search results as shown in below snapshot.

Microsoft Store: Search Windows Terminal
Microsoft Store: Search Windows Terminal

Windows Terminal Preview

You will be able to see two different results for Windows Terminal, one result for Windows Terminal and the other for Windows Terminal Preview.

Both of them will install the Windows Terminal, but as the name suggests Windows Terminal Preview is like a beta version of the terminal. It means you will get a lot of features which are not yet formally released and still under testing.

The advantage obviously is you get to know the features as soon as they are released for testing but not yet released to market. The disadvantage is because it is preview version, there may be chance that it may break or show undesired behavior.

Windows Terminal

I personally went for this stable version of Windows Terminal. So I clicked on the respective search result, which opened the Windows Terminal page. Then on the windows terminal page, I clicked on GET button to install it.

Microsoft Store: Install Windows Terminal
Microsoft Store: Install Windows Terminal

The installation took couple of seconds and that’s it. After this, I just had to type the “Windows Terminal” text to find it in start menu and click on it to start it.

Windows Terminal: tabbed view and context menu
Windows Terminal: tabbed view and context menu

If you don’t have access to the Microsoft Store, the builds are published on the GitHub releases page. If you install from GitHub, the terminal will not automatically update with new versions.

Commands Customizations

When you click on the downward facing arrow on the Windows Terminal, it will show an option with name “Settings”. If you click on it, it will open a file with name “settings.json” in your default editor.

There is a section with name “keybindings” where different keys are configured and associated with certain commands.

e.g. ctrl + shift + f opens a search box and you can search any text in the focused pane or tab. Similarly, split pane command is associated with alt+shift+d.

// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
// These two lines additionally bind them to Ctrl+C and Ctrl+V.
// To learn more about selection, visit https://aka.ms/terminal-selection
{ "command": {"action": "copy", "singleLine": false }, "keys": "ctrl+c" },
{ "command": "paste", "keys": "ctrl+v" },
// Press Ctrl+Shift+F to open the search box
{ "command": "find", "keys": "ctrl+shift+f" },
// Press Alt+Shift+D to open a new pane.
// – "split": "auto" makes this pane open in the direction that provides the most surface area.
// – "splitMode": "duplicate" makes the new pane use the focused pane's profile.
// To learn more about panes, visit https://aka.ms/terminal-panes
{ "command": { "action": "splitPane", "split": "auto", "splitMode": "duplicate" }, "keys": "alt+shift+d" }
]
view raw settings.json5 hosted with ❤ by GitHub

User Experience

I really liked the idea of having Panes in Windows Terminal. In the Windows Terminal, I can open 3 panes, one for command prompt, other for powershell and third one for Bash. All of them in the single window / tab.

Windows Terminal Preview is also bringing resizing of Windows Panes and you can configure commands for resizing in the settings.json mentioned above.

You can easily rename and recolor tabs in Windows Terminal by right clicking on the tab. The names can also include icons. This is really cool from user experience perspective.

Themes

You can also customize the themes of the Windows Terminal in simple steps.

  1. Open settings.json
  2. Go to GitHub Windows Terminal Themes OR MSDN documentation page
  3. Copy the color scheme. It is a JSON object with a name property and different color properties which are set to RGB color values.
  4. Paste this object under schemes array in settings.json file
  5. Now, go to profiles and select the profile (e.g. PowerShell. or CMD) for which you want to change the color scheme.
  6. Add a new field with name “colorScheme” and set it to the name of color scheme.

Below snippet shows a portion from settings.json file with a color scheme:

"profiles":
{
"defaults":
{
// Put settings here that you want to apply to all profiles.
"colorScheme": "FrontEndDelight"
},
"list":
[
{
// Make changes here to the powershell.exe profile.
"guid": "{aaaaabbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"commandline": "powershell.exe",
"hidden": false,
"colorScheme": "FrontEndDelight"
},
{
// Make changes here to the cmd.exe profile.
"guid": "{0caa0dad-35be-5f56-a8ff-aa9a87ff44bf}",
"name": "Command Prompt",
"commandline": "cmd.exe",
"hidden": false
}
]
},
// Add custom color schemes to this array.
// To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
"schemes": [
{
"name": "FrontEndDelight",
"black": "#242526",
"red": "#f8511b",
"green": "#565747",
"yellow": "#fa771d",
"blue": "#2c70b7",
"purple": "#f02e4f",
"cyan": "#3ca1a6",
"white": "#adadad",
"brightBlack": "#5fac6d",
"brightRed": "#f74319",
"brightGreen": "#74ec4c",
"brightYellow": "#fdc325",
"brightBlue": "#3393ca",
"brightPurple": "#e75e4f",
"brightCyan": "#4fbce6",
"brightWhite": "#8c735b",
"background": "#1b1c1d",
"foreground": "#adadad"
}
],
view raw settings.json5 hosted with ❤ by GitHub

And even if your terminal is running, it will automatically pickup the changed color scheme.

I hope this article was useful for you to setup the Windows Terminal. Let me know your thoughts.