Windows Terminal Tips, Tricks, and Productivity Hacks - Will Fuqua - E-Book

Windows Terminal Tips, Tricks, and Productivity Hacks E-Book

Will Fuqua

0,0
23,99 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Windows Terminal is a new and open-source command-line application for Windows 10, built for the Command Prompt, PowerShell, Windows Subsystem for Linux, and more. It's fast, modern, and configurable thanks to its GPU-accelerated rendering, excellent UTF-8 support, and JSON-based configurability, and this book can help you learn how to leverage these features.
You’ll start by learning the benefits of Windows Terminal and its open-source development, as well as how to use the built-in tabs, panes, and key bindings to build your own efficient terminal workflows. After you’ve mastered Windows Terminal, this book shows how to use and configure PowerShell Core and the Windows Subsystem for Linux within Windows Terminal. You’ll maximize your productivity using powerful tools such as PSReadLine for PowerShell and ZSH on Linux, and discover useful tips and tricks for common developer tools like Git and SSH. Finally, you’ll see how Windows Terminal can be used in common development and DevOps tasks, such as developing frontend JavaScript applications and backend REST APIs, and managing cloud-based systems like Amazon Web Services (AWS), Microsoft Azure, and Google Cloud.
By the end of this book, you'll not only be well-versed with Windows Terminal, but also have learned how to effectively use shells like PowerShell Core and ZSH to become proficient at the command line.

Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:

EPUB
MOBI

Seitenzahl: 247

Veröffentlichungsjahr: 2021

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Windows Terminal Tips, Tricks, and Productivity Hacks

Optimize your command-line usage and development processes with pro-level techniques

Will Fuqua

BIRMINGHAM—MUMBAI

Windows Terminal Tips, Tricks, and Productivity Hacks

Copyright © 2021 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

Associate Group Product Manager: Pavan Ramchandani

Publishing Product Manager: Kaustubh Manglurkar

Senior Editor: Sofi Rogers

Content Development Editor: Aamir Ahmed

Technical Editor: Saurabh Kadave

Copy Editor: Safis Editing

Project Coordinator: Ajesh Devavaram

Proofreader: Safis Editing

Indexer: Tejal Daruwale Soni

Production Designer: Jyoti Chauhan

First published: April 2021

Production reference: 1280421

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham

B3 2PB, UK.

ISBN 978-1-80020-756-1

www.packt.com

To my kind and loving wife, Koi, who showed the utmost patience during the writing of this book.

– Will

Foreword

Whether you are building a web app or working in the cloud, the command line has always been an integral tool for software developers and IT admins alike. For many years, the Windows command-line experience lagged behind that of Unix-based systems. Even simple things, such as selecting and copying text, required you to jump through hoops.

In the 2010s, Microsoft began to improve the command-line experience with Windows Subsystem for Linux (WSL), PowerShell improvements, and a command-line interface. WSL provided a first-party solution to running a Linux environment on your Windows device. PowerShell continued to receive incremental improvements to surpass the usability of CMD. The Windows Package Manager released a command-line interface as a first-party solution to install software on your machine. Even with all of these command-line tools, Windows lacked a solid terminal to host them in and Microsoft quickly realized how difficult it was to make improvements without breaking certain legacy behavior.

In 2019, Microsoft introduced the Windows Terminal, a new unified experience for hosting command-line tools. To make things better, Windows Terminal was open sourced alongside the in-box console host experience with which Windows command-line users were already familiar. It put customizability first, with a profile-based settings model and key bindings. Furthermore, a rapid release cycle helped to collect and address user feedback swiftly.

This book does a fantastic job of teaching you how to set up Windows Terminal and make it your own. You will learn how to create and manage your profiles to get the most out of your terminal and customize your actions and key bindings to be an effective user. Even better, you will learn how to get started using the terminal more often in day-to-day activities. The author teaches you how to use PowerShell and bash and how to customize them for your needs. The book will also teach you how to apply these tools to build apps, manage remote systems, and interact with the cloud.

Carlos Zamora

Software Engineer on Windows Terminal at Microsoft

Contributors

About the author

Will Fuqua has been developing software professionally for 12 years using a wide range of technologies. Initially based in the United States as a software consultant, he developed production systems for companies in the healthcare and finance industries, among many others. He then moved abroad and is now the Head of Engineering for an online travel agency, where he leads a high-powered technology team out of Bangkok, Thailand. You can find him online at https://fuqua.io/.

About the reviewers

Chester Liu is an open source enthusiast living in China. He got his first job as an iOS developer in 2016, after he graduated from college. During his professional career, he has worked on various platforms and in different areas. He is a long-time member of the GitHub community and has been contributing to the Windows Terminal project since 2019, after the project was open sourced by Microsoft. His contribution to the project falls into different areas, including, but not limited to, rendering, performance, and VT support.

I'd like to thank the core team of the Console subsystem at Microsoft, who I'm glad to have made acquaintance with through our collaboration in the Windows Terminal project. They went through the trouble of convincing the management to open source a deep OS component of the Windows OS itself, just to bring the community a thrilling console experience. At the end of the day, the members of the console team are the ones who dived into the legacy console source code and have been trying to improve the console experience on Windows for the past several years. Dustin L. Howett, the tech leader of the console team, is one of the coolest tech leaders I know, and I'm truly honored to be a member of his "external" team.

Daniel Engberg is a principal consultant and partner at Agdiwo, an IT services company based in Gothenburg, Sweden. Daniel's focus is Microsoft enterprise client management, including Microsoft Endpoint Configuration Manager (formerly System Center Configuration Manager), Windows 10, and PowerShell.

Daniel has been writing on his blog since 2010 and is active on Twitter.

Table of Contents

Preface

Section 1: Introducing the New Windows Terminal

Chapter 1: Getting started with the new Windows Terminal

Technical requirements

Why a new terminal?

The modern foundations of Windows Terminal

A Modern UI

Flexible JSON-based customization

Open source development

Installing Windows Terminal

Launching Windows Terminal

Summary

Further reading

Chapter 2: Learning the Windows Terminal UI

Technical requirements

Using the terminal tabs

Editing tab title appearance

Using terminal panes

Managing terminal output

Using the command palette

Keyboard shortcuts review

Summary

Further reading

Chapter 3: Configuring an Ubuntu Linux profile

Technical requirements

Why use the Windows Subsystem for Linux?

Installing Ubuntu Linux

Step 1: Install WSL2

Step 2: Install Ubuntu

Launching Linux

Installing Linux applications: nginx

Starting nginx

Bidirectional access in Windows and Ubuntu

Summary

Section 2: Configuring your Windows Terminal and its shells

Chapter 4: Customizing your Windows Terminal settings

Technical requirements

Introducing the settings.json file

Recovering from bad settings

The settings file structure

Useful Global Settings

Useful profile settings

Custom command-line profiles

Git Bash shell

SSH shell

C# interactive shell

Node.js interactive shell

Vim terminal shell

Summary

Chapter 5: Changing your Windows Terminal appearance

Technical requirements

Terminal color schemes

Built-in color schemes

Community-driven color schemes

Writing your own theme

Background images and translucency

Customizing PowerShell with posh-git, oh-my-posh, and PSReadLine

Oh-my-posh version 2

Oh-my-posh version 3

Changing the prompt without oh-my-posh

Changing command colors with PSReadline

WSL2 customization with oh-my-zsh

Command Prompt customization

Summary

Chapter 6: Setting up keyboard shortcuts

Technical requirements

Overview of the keyboard shortcut system

Building custom commands with "sendInput"

Configuring custom terminal layouts with "wt"

Additional uses of 'wt'

Summary

Chapter 7: Hidden Windows Terminal Actions

Technical requirements

Discovering unbound actions

Using actions for focus management

togglePaneZoom

toggleAlwaysOnTop

toggleFocusMode

Using actions for visual effects

setColorScheme

toggleShaderEffects

Using actions for tab manipulation

Closing multiple tabs at once

Changing tab colors

Summary

Chapter 8: Tips for using PowerShell like a Pro

Technical requirements

Installing PowerShell Core

Using built-in commands and aliases

Automatic Variable: $^ and $$

cd - and cd +

The ii command

History navigation with h and r

Pipelines and $_

Custom Profile Aliases and Functions

Configuring PSReadLine in PowerShell Core

EditMode

History Search

Better autocompletion

Command predictions

Programmable shortcuts

Adding the GNU coreutils to the path

Installing the z utility

Addendum – the full PowerShell $profile file

Summary

Chapter 9: Tips for Using Ubuntu like an Expert

Technical requirements

Using Ubuntu with Windows

Accessing Linux directories from Windows

Accessing Windows directories from Linux

Running Linux programs from inside Windows

Running Windows programs from inside Linux

Installing and configuring software

Choosing your shell

Using ZSH

Rerunning earlier commands

Using ZSH substitutions

Configuring aliases and functions

Quickly navigating to directories

Installing and using oh-my-zsh plugins

Enabling the z plugin

Enabling vi-mode

Installing zsh-autosuggestions

zsh-syntax-highlighting

Summary

Section 3: Using your Windows Terminal for development

Chapter 10: Using Git and GitHub with Windows Terminal

Technical requirements

Creating a modern Git installation

Installing Git

Installing OpenSSH

Starting our OpenSSH Agent

Setting up a private/public key pair

Testing our SSH authentication

Authenticating with Git on Linux

Tips for using Git effectively

Switching Git branches with git checkout -

Fixing typos with Git's autocorrect

Pushing to HEAD

Git aliases and command aliases

Tig

Viewing files on different branches

git reflog

Using GitHub from Windows Terminal

Creating repositories

Viewing pull requests

Checking out Pull Requests

Summary

Chapter 11: Building web applications with React

Technical requirements

Installing Node.js in WSL2

Adding a Node.js profile to Windows Terminal

Creating a React app

Developing in WSL2

Developing with a modern workflow

Summary

Chapter 12: Building REST APIs with C# and Windows Terminal

Technical requirements

Installing .NET and C#

Using dotnet script from Windows Terminal

Generating our REST API

Testing our REST API

Making changes to our REST API

Running unit tests with Windows Terminal

Summary

Chapter 13: Connecting to remote systems

Technical requirements

Connecting to Windows computers with WinRM and SSH

Connecting with WinRM

Connecting to Windows computers with SSH

Copying files with SCP

Connecting to Linux machines

Saving routinely accessed hosts and commands

Starting remote connections in Windows Terminal

Summary

Chapter 14: Managing systems in the cloud

Technical requirements

Using Microsoft Azure's Cloud Shell and az interactive

Using az interactive

Using Google Cloud Shell and gcloud interactive

Using gcloud beta interactive

Using AWS from Windows Terminal

Using aws-shell

Using the AWS Tools for PowerShell

Summary

Appendix Windows Terminal Actions

Other Books You May Enjoy

Preface

Windows Terminal is a modern and open source command-line program for Windows 10, built for Command Prompt, PowerShell, Windows Subsystem for Linux (WSL2), and more. It's fast and flexible, but to use it effectively we need to understand both Windows Terminal and the shells that run inside it. We'll explore these technologies in detail throughout the three sections of this book.

We'll start by covering the benefits of Windows Terminal, including its GPU-accelerated rendering and JSON-based configurability. We'll learn how to use and customize the built-in tabs, panes, and key bindings to drive our own beautiful and efficient terminal workflows.

Next, we'll show how to use PowerShell Core and the Windows Subsystem for Linux within Windows Terminal. We'll maximize our productivity using powerful tools such as PSReadLine on PowerShell and ZSH on Linux, and pick up some time-saving tricks for common developer tools such as Git and SSH.

Finally, we'll see how Windows Terminal can be used in common development and DevOps tasks, such as developing frontend JavaScript applications and backend REST APIs and controlling Amazon Web Services, Azure, and Google Cloud.

By the end of this book, we'll not only be experts on Windows Terminal, but we'll also know how to use shells such as PowerShell Core and ZSH to become proficient through the command line.

Who this book is for

This book is for developers, DevOps engineers, and sysadmins who want to become advanced command-line power users. Whether you're new to the command line or you use PowerShell every day, this book will have something for you.

What this book covers

This book covers Windows Terminal up to version 1.7, and comprises the following chapters.

Section 1 – Introducing the New Windows Terminal

Chapter 1, Getting started with the new Windows Terminal, discusses how Windows Terminal works with existing shells such as PowerShell, cmd.exe, and the Windows Subsystem for Linux. It discusses the speed, configurability, and open source development of Windows Terminal, and how to install, update, and launch it.

Chapter 2, Learning the Windows Terminal UI, covers how to use Windows Terminal's tabs, manage terminal panes, and open different shells, including PowerShell and cmd.exe. Relevant hotkeys are mentioned wherever applicable and useful. This chapter covers all the major parts of Windows Terminal's UI.

Chapter 3, Configuring an Ubuntu Linux profile, gives an overview of the benefits of the Windows Subsystem For Linux (WSL2), guides you through setting up a WSL2 Ubuntu system, and shows how to launch it as a Windows Terminal profile. It also discusses how to access Windows from Linux, and vice versa.

Section 2 – Configuring your Windows Terminal and its shells

Chapter 4, Customizing your Windows Terminal settings, covers the settings.json file and the settings UI. It guides you through the overall structure and editing of this file and covers a number of useful settings to enable in Windows Terminal.

Chapter 5, Changing your Windows Terminal appearance, shows how to tweak the appearance of Windows Terminal to make it both beautiful and more functional. It broadly has two parts: customizing Windows Terminal itself and then customizing the shells to match.

Chapter 6, Setting up keyboard shortcuts, covers the basics of Windows Terminal's command/key binding system, and recommends some additional key bindings to set.

Chapter 7, Hidden Windows Terminal Actions, details the many commands that are hidden by default—that is, unbound and inaccessible until they're mapped to keyboard shortcuts in the settings. This chapter covers some of the more practical hidden key bindings, such as "focus mode" and "pin on top."

Chapter 8, Tips for using PowerShell like a Pro, focuses on using PowerShell as an interactive shell in Windows Terminal. It shows some time-saving tips and tricks for accomplishing tasks quickly and effortlessly.

Chapter 9, Tips for using Ubuntu like an Expert, covers how to use WSL2 Ubuntu with Windows. Additionally, this chapter shares a selection of useful tips for configuring WSL2 Ubuntu in Windows Terminal to provide a richer and more productive environment.

Section 3 – Using your Windows Terminal for development

Chapter 10, Using Git and GitHub with Windows Terminal, contains tips and tricks for using Git and GitHub quickly and efficiently. It covers both the initial setup and the installation of these systems, as well as workflow optimization tools such as gh.

Chapter 11, Building web applications with React, covers how to build a frontend React application inside WSL2 using Windows Terminal and VS Code. It focuses on efficient workflows when using Windows Terminal for frontend development.

Chapter 12, Building REST APIs with C# and Windows Terminal, shows how to build a simple web API using .NET. It details various Windows Terminal pane layouts for running the application, continuously testing, and experimenting with C#.

Chapter 13, Connecting to remote systems, introduces both WinRM and SSH. It uses SSH to connect remotely to both Windows and Linux systems, and provides useful tips on how to create a streamlined setup for connecting to frequently used remote machines.

Chapter 14, Managing systems in the cloud, covers setting up Azure Cloud Shell and Google Cloud Shell in Windows Terminal, and additionally covers the Amazon Web Services command line for administering cloud systems.

To get the most out of this book

To get the most out of this book, you'll need a relatively up-to-date version of Windows 10. The minimum required version is Windows 10 version 1903 (build 18362), which was released in May 2019. Some of the more advanced features in this book will require a more up-to-date version. Any chapter that requires a more up-to-date version will make this clear at the beginning of the chapter.

If you are using the digital version of this book, we advise you to type any code or configuration options yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to copying and pasting from PDFs or ebook readers.

Download the example configuration and code files

You can download the example configuration and code for this book from GitHub at https://github.com/PacktPublishing/Windows-Terminal-Tips-Tricks-and-Productivity-Hacks. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781800207561_ColorImages.pdf

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, configuration files, folder names, filenames, file extensions, and program names. Here is an example: "To ping the server, run ping example.com from the terminal."

A block of code is set as follows:

{

  "command": "togglePaneZoom",

  "keys": "alt+shift+z"

}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

{

  "command": "togglePaneZoom",

  "keys": "alt+shift+z"

}

Any command-line input or output is written as follows:

mkdir my-project

cd my-project

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Select System info from the Administration panel."

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.

Section 1: Introducing the New Windows Terminal

In this section, we'll learn to make efficient use of Windows Terminal. We'll start out learning about what Windows Terminal is and why it's interesting, and then quickly move on to installing and using it. We'll cover all the user interface components of Windows Terminal, including tabs, panes, and the profile menu. We'll also set up an Ubuntu profile using WSL2, so we'll have functioning PowerShell, cmd.exe, and Ubuntu profiles ready to use!

This section comprises the following chapters:

Chapter 1, Getting started with the new Windows TerminalChapter 2, Learning the Windows Terminal UIChapter 3, Configuring an Ubuntu Linux profile

Chapter 1: Getting started with the new Windows Terminal

At the Build 2019 conference, Microsoft made an exciting announcement: Windows 10 was getting a brand new command-line terminal! Custom built for the command prompt, PowerShell, and the Windows Subsystem for Linux, this new terminal promised to bring a modern, configurable, and open source command-line experience. In May 2020, Microsoft released the 1.0 version of the new Windows Terminal.

Windows Terminal is a separate application from the old Windows command line. This approach allows both terminals to live side by side, and enables Microsoft to rapidly release new features for Windows Terminal without endangering the backward compatibility of the old terminal.

By the end of this chapter, we will be up and running with Windows Terminal, having covered the following topics:

Why a new terminal?The modern foundations of Windows TerminalInstalling Windows TerminalLaunching Windows Terminal

We'll cover why Windows needed a new terminal at all, how this new terminal is radically different from the old one, and take our first steps to download, install, and launch it.

Technical requirements

To get started with Windows Terminal, you'll need a Windows 10 installation with access to the built-in Microsoft Store application. The minimum version of Windows 10 supported is the May 2019 Update (version 1903, as reported in the output of the winver command). If you have a relatively up-to-date Windows 10 installation, you have all the tools you need to get started.

Why a new terminal?

Microsoft's old terminal, conhost.exe, has been showing its age. While it has seen some impressive improvements lately, such as ANSI/VT support and advanced settings, the primary goal of conhost.exe is to be backward-compatible with older applications. This backward-compatibility constraint can sometimes be at odds with the fast-paced improvements in other parts of Windows 10.

While both PowerShell and the shells running under Windows Subsystem for Linux (WSL) have been seeing constant, rapid improvement, the "user experience" of the Windows command line was in vast need of an upgrade, when compared to its macOS and GNU/Linux counterparts.

As we're getting started, it's useful to understand the difference between a terminal and a shell. A terminal is essentially "what you see" when using the command line—it renders the text, draws any user interface (UI) widgets, and accepts keyboard and mouse input. The terminal will then send this input to the shell for processing. The old terminal on Windows was called conhost.exe and was the only built-in terminal; however, there were and still are alternative third-party terminals such as ConEmu and Hyper.

A shell doesn't have a UI; it's a command-line program that receives input from the terminal, evaluates that input, and returns the result. Shells, such as the command prompt, PowerShell, and those running in WSL, require a terminal to collect input and display output. Launching the cmd.exe or powershell.exe shells from the Start menu or Run dialog will implicitly start the conhost.exe terminal, which can make the distinction less obvious for end users:

Figure 1.1 – PowerShell, running in both the old conhost on the left, and the new Windows Terminal on the right

This delineation between terminals and shells means that switching to the new Windows Terminal is painless—the shells, such as the command prompt and PowerShell, are not changing. All existing knowledge and documentation of the command prompt, PowerShell, and shells under WSL can be reused, but commands will be sent through the new, more powerful Windows Terminal instead of the older, more barebones conhost.exe. Let's see what makes this new Windows Terminal so much better!

Note

A more in-depth discussion about the differences between shells and terminals can be found on Scott Hanselman's blog at https://www.hanselman.com/blog/whats-the-difference-between-a-console-a-terminal-and-a-shell.

The modern foundations of Windows Terminal

Earlier, we learned that Windows Terminal is built from the ground up to provide a more modern and flexible command-line experience. This command-line experience has three main parts: a modern UI, a flexible JSON-based customization system, and its open source development.

A Modern UI

When working with the command line, it's common to have a couple of command lines open. Perhaps a couple of operations need to be monitored at the same time, or some commands need to execute in PowerShell, and others need to use WSL. In the old terminal, the only option is to open separate windows and then Alt + Tab between them.

The new Windows Terminal comes with multiple options for managing these tasks. It features built-in tab support, each tab with its own shell, and all available within the same window:

Figure 1.2 – The new Windows Terminal with multiple shells open in tabs

Additionally, some operations work best with multiple shells open side by side. The old terminal again had no support for this; the only option was to use separate windows positioned next to each other. The new Windows Terminal supports "panes" that can open multiple different shells within the same tab. It's not just limited to two panes, either—the terminal supports multiple side-by-side panes split both vertically and horizontally:

Figure 1.3 – The new Windows Terminal with multiple shells open in a single tab

We'll dive more into efficient tab and pane management in Chapter 2, Learning the Windows Terminal UI.

Improved visual effects

The modern UI features are not just limited to tabs and panes; the entire terminal has been written from the ground up to take advantage of the latest technology. The terminal itself is written using the Universal Windows Platform (UWP) framework with XAML Islands, and text rendering is handled by a GPU-accelerated rendering engine using DirectX.

This technology stack, in addition to being a flexible, fast, and solid foundation, enables improved visual effects as well. For example, the new Windows Terminal natively supports transparency using an effect called acrylic, as well as background images and GIFs:

Figure 1.4 – Left pane: PowerShell with the acrylic transparency effect. Right pane: cmd with a background image

Improved fonts and rendering

The new, GPU-accelerated rendering engine has all the modern features expected for a first-class command-line experience. The GPU acceleration results in ultra-fast and crisp text rendering, and the new rendering engine enables Unicode character support. While full, multi-language Unicode support is still a work in progress, the foundation is laid.

To show off the new Windows Terminal's font-rendering capabilities, Microsoft released a brand-new open source programming font named Cascadia Code, which is bundled in Windows Terminal:

Figure 1.5 – The Cascadia Code font at a selection of font weights

Cascadia Code currently has support for a wide range of characters, including Cyrillic, Greek, and Vietnamese. It's open source, licensed under the SIL Open Font License, so progress for supporting additional languages can be tracked on GitHub, at https://github.com/microsoft/cascadia-code/.

Cascadia Code is called a programming font due to its support for optional programming ligatures. A ligature is a font feature that allows multiple characters to be rendered as a single glyph. For example, when typing the characters in the first row in the following image, they will be rendered as the bottom row:

Figure 1.6 – Top: characters as typed and stored. Bottom: ligatures as rendered

In addition to programming ligatures, Cascadia Code also supports Powerline glyphs, a popular terminal customization that can improve the look of the command-line prompt, making it stand out from the input/output text around it:

Figure 1.7 – Powerline prompt rendered using Cascadia Code PL

As mentioned, all these features are optional—the Cascadia font comes in four variations that allow enabling or disabling of both programming ligatures and Powerline glyphs:

Figure 1.8 – Cascadia font variations

We'll cover Powerline customization in detail in Chapter 5, Changing your Windows Terminal appearance.

Flexible JSON-based customization

Customization of the old terminal was quite frustrating; the options were distributed across both the Windows Registry and inside the shortcut files themselves! The new Windows Terminal fixes this and features a settings.json file with a documented schema.

The benefit of using a JSON file with a schema is two-fold: editors such as Visual Studio Code can provide a first-class editing experience with documentation and autocomplete, and the settings.json file can be version-controlled and easily shared across computers.

Figure 1.9 – Editing settings.json in Visual Studio Code, with autocompletion of available settings

Additionally, the built-in Settings UI provides an easier way to customize the terminal. The Settings UI still uses the settings.json file behind the scenes, so the resulting configuration can still be easily shared and version controlled.

Figure 1.10 – The Settings UI in Windows Terminal

The settings.json file controls all aspects of the terminal, such as its themes and colors, keybindings, and window behavior. We'll dive deep into this file in Chapter 4, Customizing your Windows Terminal settings.

Open source development

The new Windows Terminal is open source! All development happens on Microsoft's GitHub repository, at https://github.com/microsoft/terminal/. The development team is incredibly active in this repository; bug reports, feature planning, and feature development happens in the open. Reading through this code repository, downloading the code, and even contributing to it is encouraged!

Figure 1.11 – The Windows Terminal GitHub repository

In addition to open source code, the documentation itself is open source. The documentation is hosted at https://aka.ms/terminal-docs, and clicking the Edit this Document link will navigate to the relevant document on GitHub. Edits to the documentation follow the typical pull request process, using Markdown for formatting.

The repository has hundreds of open source contributors, working on all aspects of the terminal. Several major features, such as background image support, have been added by the community. Whether it's improving documentation, submitting bug reports, or discussing and then adding features, feel free to get involved! Check out the CONTRIBUTING.md file in the GitHub repository to get started.

Now that we've covered the benefits of the new Windows Terminal, let's take our first step and get it installed!

Installing Windows Terminal

There are several ways to