In the last few chapters, you worked with your application and the IoT hub. In this chapter, I want to give you pro tip—using the Windows Terminal command-line tool, which you can customize. Yeah, you heard me right. In this chapter, I show how you can use and customize that tool. If you are not interested in using this tool, feel free to skip this chapter.
Using Windows Terminal
Windows Terminal is a new, fast, modern, efficient terminal application for users of command-line tools and shells, like command-prompt, PowerShell, and WSL. You can easily download the terminal from Microsoft Store, as shown in Figure 6-1.
Windows Terminal Key Features
Once you open Windows Terminal, you can see the fresh look of this new command-line tool. It has an updated UI and many new features, some of which we discuss next.
Support for Multiple Tabs
The new terminal supports multiple tabs, each connected to a command-line shell or app of your choice. See Figure 6-2.
Support for Emojis, Icons, and More
With the new terminal, you can display text characters, glyphs, and symbols present on your windows, including emojis, powerline symbols, icons, and more.
Configuring Windows Terminal
The new terminal gives you the option to customize your terminal, including:
Multiple profiles for each shell/app/tools you use.
Separate font styles, color themes, backgrounds, and transparency levels for each profile.
The configuration is stored in a structured text file so that anyone can easily edit it. To edit the settings file (called settings.json), just click the Settings button, as shown in Figure 6-3.
The settings.json file will open in your default code editor. You should see the profiles section with possible names Windows PowerShell, Command Prompt, Ubuntu-20.04, or Azure Cloud Shell. You can edit these profiles as you wish; for example, you could edit the Ubuntu-20.04 profile as follows:
Now if you open the Ubuntu-20.04 shell, you’ll see that all the settings are updated. Note that the starting directory has changed as well.
Windows Terminal Preview Version
There is also a preview version of Windows Terminal, planned to be released in July of 2020. This version offers many other features. Let’s look at them now.
Open Folders in Windows Terminal
You can right-click any folder and select Open in Windows Terminal, which will launch Windows Terminal with your default profile in the directory you selected from File Explorer.
Font Weight Support
The preview version supports font weight as a new profile setting. The possible values of the fontWeight property are normal, thin, extra-light, light, semi-light, medium, semi-bold, bold, extra-bold, black, extra-black, or an integer corresponding to the numeric representation of the OpenType font weight. You place the values in quotes, as follows:
"fontWeight": "normal"
Support to Open a Profile as a Pane
If you want to open a profile as a pane in the current window, all you have to do is press and hold the Alt key and then click the profile. This will open the profile as a pane by using the auto-split feature. See Figure 6-4.
Change the Tab Color
To change the color of a tab, just right-click the tab and select Color, which will open a color menu. Then you can select the color you wish. See Figure 6-5.
Rename a Tab
There is also an option to rename a tab. To do that, just right-click the tab and select Rename Tab. This will change your tab title to a textbox, where you can rename the tab for that terminal session.
Summary
Isn’t it cool that you can design your terminal? So, in this chapter, you learned: