Windows Terminal Tips, Tricks, and Productivity Hacks
eBook - ePub

Windows Terminal Tips, Tricks, and Productivity Hacks

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

Will Fuqua

Buch teilen
  1. 254 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Windows Terminal Tips, Tricks, and Productivity Hacks

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

Will Fuqua

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Become an efficient command-line expert by harnessing the power of the new Microsoft Windows Terminal, and learn time-saving tricks for PowerShell, WSL2, and more

Key Features

  • Customize and optimize your Windows Terminal and its shells
  • Work effectively on the command line with split panes, hotkeys, and automation
  • Use PowerShell and WSL2 efficiently to build, test, and deploy applications

Book Description

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.

What you will learn

  • Install, update, and use Windows Terminal and its preview version
  • Customize your Windows Terminal to be both visually appealing and functional
  • Enable and effectively use the latest versions of PowerShell Core and Windows Subsystem for Linux
  • Install and configure time-saving tools for the command line
  • Work efficiently with common developer tools such as Git and SSH
  • Build, deploy, and manage apps in the cloud using Windows Terminal
  • Use Linux tools from Windows with ease

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 already use Windows PowerShell every day, this book will have something for you.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Windows Terminal Tips, Tricks, and Productivity Hacks als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Windows Terminal Tips, Tricks, and Productivity Hacks von Will Fuqua im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Microsoft Programming. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2021
ISBN
9781800209640

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 1Getting started with the new Windows Terminal
  • Chapter 2Learning the Windows Terminal UI
  • Chapter 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 Terminal
  • Installing Windows Terminal
  • Launching 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
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 ...

Inhaltsverzeichnis