Understanding and Using Windows Terminal
Microsoft describes Windows Terminal as a “modern host application” for various Windows command-line shells, including Windows PowerShell, the Command Prompt, the Bourne Shell (aka bash, via Windows Subsystem for Linux), and more. By careful design, Windows Terminals lets users run multiple command-line sessions simultaneously, so they can arrange multiple tabs and panes. Windows Terminal also supports incredible customization capabilities that include various pre- (and user-) defined themes, text displays, backgrounds, shortcuts, and more.
Check Out the Other Windows Terminal Articles
This article is the first in a series on Windows Terminal that explains its customization and usage step-by-step, so readers can take advantage of its capabilities. Here, you’ll find an overview and simple illustrations of what Windows Terminal can do. In the follow-up articles, you’ll dig into topics and capabilities related to specific Windows Terminal facilities and customizations, along with some interesting and useful add-ons:
- Understanding and Using Windows Terminal Color Schemes: Explains the contents and behavior of Windows Terminal color schemes, with tools to display and inspect them.
- Using Text, Tabs, Panes, and Themes in Windows Terminal: Explains how to inspect, set and change text and background colors in Windows Terminal, how to split the display into horizontal and vertical panes, and more.
- Using OhMyPosh to Customize the Windows Terminal Prompt: Discusses Jan de Dobbeleer’s outstanding OhMyPosh add-in for PowerShell. OhMyPosh uses nerd fonts to provide extraordinary and interesting visual effects at the command line, including nearly five dozen themes, each with its own color scheme and output style.
- Creating and Sharing Windows Terminal Profiles Across PCs: Explains how you can synchronize and maintain the same look, feel, and capabilities for Windows Terminal across multiple physical or virtual PCs.
A Windows Terminal Overview, With Lightning Tour
Any Windows application that supports a command-line interface will run inside Windows Terminal. In common practice, this includes the following familiar command-line environments, also known as “Windows Shells”:
- The Command Prompt environment: This environment traces its lineage back to the so-called “DOS prompt” available in Windows versions starting with Windows NT in 1988. See this terrific MS Developer Blog post Windows Command-Line: The Evolution of the Windows Command-Line for a great historical review and retrospective.
- PowerShell: A deliberately designed replacement for the Command Prompt, PowerShell emerged from mid-2005 through late 2006 (public release: November 14, 2006). It sought to provide better and more direct access to OS objects, variables, and data through a robust and flexible programming interface. Along with its command-line interface, PowerShell uses the .NET Common Language Runtime (CLR) to provide powerful scripting that is extensible through functions, classes, scripts, and modules with built-in formatting systems, support for user and pre-defined dynamic data types, and support for common data formats (for example, XML, JSON and CSV). See the Microsoft Learn article What is PowerShell? for a basic introduction, and pointers to more information and learning materials.
- Azure Cloud Shell: A cloud-based shell environment for managing Azure resources that works through a Web browser using either PowerShell or Bash. For more information on working with the Azure Cloud Shell, see this Microsoft Learn article Overview of Azure Cloud Shell.
- Bourne Shell (also known as Bash): The Windows Subsystem for Linux (WSL) enables users to install one or more Linux distributions (by default, Ubuntu) into the Windows runtime environment. Ubuntu (and many or most other Linux distros) support Bash as part and parcel of their operation. For more information, try the Microsoft Learn articles Getting started with Linux and Bash and Basic Commands for WSL.
Figure 1 shows a pop-up menu in Windows Terminal that (among other things) shows the various shells available, for which multiple, individual invocations may be opened within its confines. As you will learn later in this article, and follow-ons in this series, this opens a wide range of possibilities for access, display, and customization within Windows Terminal.
As you can see, the first four menu items all reference various Windows shells, including two versions of Windows PowerShell (positions 1 and 3), Command Prompt (position 2), and the Azure Cloud Shell (position 4). Windows installations with WSL installed also gain a Shell item named “Ubuntu” that opens a Bash session tab when invoked.
Running Multiple Sessions and Shells
Users can open multiple instances of the same shell, and instances of different shells, in a single Windows Terminal window. Each invocation opens a new tab by default. Figure 2 shows a Windows Terminal window with instances of the first three shells shown in Figure 1. The default shell (the black instance of PowerShell, the most current version, 7.3.4) appears at left, with Command Prompt in the middle, and the original PowerShell version (5.1.22621.1778; 5.1 first appeared in August 2016) at right.
This approach is a bit limiting because one can see only one tab at a time. No problem: As I’ll explain in a follow-on article, Windows Terminal includes controls to arrange for combinations of side-by-side and stacked panes within its overall window boundaries. Watch this fantastic demo to see how multiple Windows Terminal panes can be more artfully arranged around each other. Indeed, it shows a PowerShell pane to the left, with Command Prompt at top right, and Ubuntu at bottom right. Good stuff!
In addition, Windows Terminal also offers the ability to use a custom background and provides rich controls over text and window appearance. These controls apply to fonts, weights, color schemes, and themes. They even support use of fancy specialized fonts called “nerd fonts.” Nerd fonts supply dramatic and colorful character glyphs and displays, which can be used for colorful arresting visuals and prompt layouts. (See the many pre-defined Oh My Posh themes for a sense of the possibilities this creates.)
Upon deeper investigation, in fact, the range of available layouts and customizations for Windows Terminal is absolutely dizzying. Figure 3 presents some of these, with the default theme from OhMyPosh and a “red flag” to signal a command-line input error. (The blue check mark at right center indicates the preceding command line input completed successfully.)
Other Notable Windows Terminal Features and Capabilities
Windows Terminal includes a rich set of shortcuts that come pre-defined for whatever command line is showing in its active window. Those shortcuts are documented in bits and pieces amidst the MS documentation, but you can find a more complete list at WebNots: Keyboard Shortcuts for Windows Terminal App. As with most everything else about Windows Terminal, you can create your own shortcuts, or redefine existing ones, as explained in the Microsoft Learn pages Custom actions in Windows Terminal.
Other capabilities inside Windows Terminal include the following:
- Complex character set support: Windows Terminal supports the complete Unicode and UTF-8 character sets, which include support for over 100 human languages and multiple sets of emoji characters.
- Accelerating text rendering: Windows Terminal can use a PC’s graphics processing unit (GPU) to render and deliver its text output. This provides a significant and noticeable performance improvement over the original Command Prompt environment, which relies on simple “text in a window” capabilities for output.
- Launch controls: Windows Terminal itself works with invocation commands to run in specific configurations and with specific profiles. You can open a new tab, position panes, select a start-up folder, and change the active session focus, all from the command line. This provides a fascinating and surprisingly general and robust set of controls for firing off Windows Terminal windows and panes, as described in the Microsoft Learn article Using command line arguments for Windows Terminal. Visit that item for an interesting and compelling demo of capabilities including an animated demo that plays on that web page.
- Complex command palette: Windows Terminal provides direct access to its controls through the command palette (down caret menu item or use the CTRL+Shift+P key combination). The default version is shown in Figure 4 but, as with most everything else about Windows Terminal, this palette is also entirely customizable. Use it to manage windows, tabs, panes, and more in the Windows Terminal environment.
- Background image controls: If you look back at Figure 3, you’ll see a dimmed-out (37 percent opacity, in this example) instance of a Windows Spotlight image. Spotlight is the collection of photographs that Microsoft bundles with Windows 10 and Windows 11 for rotating lock screen and background images. Windows Terminal lets you pick and manage image sources for the backdrops to Windows Terminal windows, tabs, and panes.
- Ability to drag tabs: A preview for Windows Terminal adds the ability to “tear off” tabs in any of its windows and drag them to other parts of the display as separate, independent Windows. As I write this article, the latest Windows Terminal Preview version is 1.18.1462.0. The preceding link to the preview should continue to lead to the most current Windows Terminal Preview though the Microsoft Store.
Windows Terminal Notes and Resources
Starting with the Windows Terminal overview from Microsoft Learn, you can find a plethora of resources on this terrific host environment online. This starting point links to other helpful and informative Microsoft Learn resources, most notably:
- Dynamic profiles in Windows Terminal explains how Windows Terminal automatically creates profiles for WSL and PowerShell without having to go through manual setup.
- Windows Terminal tips and tricks explains and illustrates key shortcuts, defaults, and Windows Terminal tweaks to help users get started on their personal customization journeys. Informative and fun!
- Windows Terminal tutorials available include working with Oh My Posh, using the secure shell (SSH) client for remote access in a Windows Terminal session, and more.
- Various customized Windows Terminal instances appear in a gallery, and include a custom terminal guide, plus instances for Raspberry Ubuntu, Frosted Glass, and Retro Command Prompt themes.
Of all the many—and absolutely amazing—Windows Terminal customization “war stories” and “how-tos” available online, my personal favorite is from long-time MS development legend and guru Scott Hanselman. This gripping tale is entitled My Ultimate PowerShell prompt with Oh My Posh and the Windows Terminal. He explains and shows how he integrated the output from his blood sugar monitor into his Windows Terminal prompt in PowerShell. It’s completely riveting and includes great advice on how to avoid common pitfalls or misunderstandings on the customization trail. Check it out!