The in and outs of Microsoft's new Windows Terminal

Handy features in the Store applications, but the underlying infrastructure changes matter more

You can set a background for the new terminal - we like this one
You can set a background for the new terminal - we like this one

Hands On Microsoft's new terminal app is now available in the Windows Store - so naturally your vultures took it for a spin.

What's the point of the new Windows terminal? There are a few things. One obvious one is multi-tab support. You can click + to add a tab. There is also a drop-down menu that lets you select which command line application - such as cmd, PowerShell, a Windows Subsystem for Linux distribution – you would like to use.

Each of these drop-downs is a "profile" and you can configure the profile, or add new ones, by editing the file profiles.json, which lives in your AppData\Local folder.

The new Terminal in the Microsoft Store

The new Terminal in the Microsoft Store

The new Windows Terminal is a UWP (Universal Windows Platform) application, as evidenced by the ugliness of the tab bar and the over-sized plus symbol. If you download the newly open-sourced Terminal code from GitHub you will find several sections included (each containing multiple projects). Windows Terminal is the Store app codenamed "Cascadia", but there is also Conhost, which currently builds as OpenConsole.Exe, a Win32 / Win64 (or ARM64) application.

Windows Terminal has tab support and background image options, but there are also changes in OpenConsole.exe versus what you get if you run cmd today. Currently Windows Terminal installs its own copy of OpenConsole.exe, renaming it to the traditional conhost.exe.

Windows Terminal

The Windows Terminal turns up in the Microsoft Store

READ MORE

Microsoft's efforts with the Windows command line are partly to do with usability, and partly to do with compatibility with Unix-like operating systems, especially Linux. Historically, Windows command-line applications have worked though a ConHost API. When an application like Cmd or PowerShell starts up, it gets connected to an instance of ConHost.

This has caused a number of issues for third-party console applications like OpenSSH (Secure Shell) as well as for Microsoft's own Windows Subsystem for Linux. Some applications have been forced to open a command prompt off-screen and scrape its contents in order to work.

Unix-like operating systems use a Pseudo Terminal (PTY) which sends and receives text. This works fine for both local and remote terminal applications. Windows has been moving towards the Unix/Linux model, introducing a Windows Pseudo Console called ConPTY which sends and receives text as an alternative to the old API. This was introduced in the 1809 (October 2018 update) of Windows 10.

A related feature is the gradual introduction of support for VT (Video Terminal) escape sequences, based on an ancient system for formatting text by including codes prefixed with the Esc character. Again this is the Unix-like way to do things versus the Windows Console API. Microsoft is embracing this, hence Program Manager Richard Turner's appeal in December 2018: "start writing (or update existing) Command-Line apps to emit VT enriched text, rather than calling Win32 Console APIs to control/format Console output."

The VT approach now has superior features including 24-bit colour support and a proper concept of foreground and background. This is why the latest Insider Build of Windows 10 includes a "Terminal" tab in Command Prompt properties.

In the new command line infrastructure, Microsoft puts ConHost's ConPTY between new console applications like Windows Terminal and the old Windows Console API, enabling both approaches to work.

The new command line infrastructure in Windows 10

The new command line infrastructure in Windows 10

These changes are more significant than the new Windows Terminal application, even though less visible to most users.

You do not need to run Windows Terminal to get features like Ctrl-Scroll to enlarge or reduce the font size: this works in cmd as well.

A vulture's view

So how is the prototype Windows Terminal now available in the Microsoft Store? It is described as an "early preview" and some features are missing, particularly in the areas of support for assistive technology, which should come in the next update.

The best thing about it is the profile support. Hit Settings in the menu, and profiles.json opens in Visual Studio Code; a crude approach if you are used to the Windows GUI, but effective; perhaps it will stay this way. Make modifications and save, and Windows Terminal instantly updates. This works. Alternatively, if you left out a comma or otherwise broke the JSON, a "Failed to reload settings" message appears.

The profiles let you define specific command lines. For example, you could set up a Visual Studio Developer Command Prompt here, or run a batch file set up for a particular version of Java. You can also configure shortcut keys for commands like New Tab, or New Tab with Profile n, or Switch to Tab n, or to use custom key combinations for text navigation.

Windows Terminal now uses GPU-based text rendering (DirectWrite and DirectX), which means high quality fonts as well as emoji and so on if you want them.

The main reservation is that a desktop version of Windows Terminal, rather than one built using UWP, would probably be even better. Perhaps that would be a step too far for Microsoft, which is willing to do whatever it takes to support Linux, but not yet ready to admit to the difficulties facing UWP. ®

Sponsored: What next after Netezza?

SUBSCRIBE TO OUR WEEKLY TECH NEWSLETTER




Biting the hand that feeds IT © 1998–2019