May 8th, 2024

Windows Terminal Preview 1.21 Release

Christopher Nguyen
Product Manager II, Windows Terminal

Windows Terminal is back with another preview release! Windows Terminal Preview 1.21 introduces long-awaited features like Buffer Restore and fontfall back as well as new experimental features like Scratchpad and the ability to load up an image as a texture. There’s also a LOT MORE stuff so check out the rest of this blog post to learn more!

We are also updating Windows Terminal stable to version 1.20 which will include all of the features from this previous blog post. You can install Windows Terminal and Windows Terminal Preview from the Microsoft Store, from the GitHub releases page, or by using winget.

If you are interested in our bleeding edge features, you can also download Windows Terminal Canary from our GitHub repo.

Now let’s learn more about Windows Terminal Preview 1.21!

Buffer Restore

Windows Terminal can now remember the contents of the screen and restore them on startup. To enable this, you will have to select “Open windows from a previous session” in your Startup settings.

Image Startup Settings for Buffer Restore

Buffer snapshots are stored in Virtual Terminal-encoded text within your package’s local state directory. This directory is typically secured to your user account. Please be aware of these implications if you plan to enable this feature while using a portable distribution of Windows Terminal.

Image of the buffer being restored on startup.

Font Fallback

The font face setting in your profiles’s appearance settings now support multiple fonts and you can use commas to list them out. Glyphs which are not found in your first font will be sought in all later fonts.

Below is an example of my PowerShell profile’s font face setting supporting Cascadia Mono NF and MS Gothic:

Image FontFallback

New Font Settings

Speaking of fonts, we have added new settings to allow you to customize the OpenType Features and Axes of your font stack. We have also added settings to allow you to toggle whether you want to use built-in glyphs or full-color emojis (this one is my personal favorite 😉)

Image New Font Settings

Here is what emojis look like with the full-color emoji setting turned off:

Image No Color Emojis

New Advanced Settings in the Settings UI

Speaking of settings, we have also added four new settings to the Settings UI in your profiles’s advanced settings. These are settings that enable the right-click context menu, display scrollbar marks (which are now pretty stable!), automatically mark prompts, and allow you to reposition the cursor with mouse clicks (experimental.)

Image of New Advanced Settings

In the past, these settings could have only been adjusted via the settings.json file but now they can also be adjusted in the Settings UI 🙂

Rendering Updates

If you look at the Rendering settings of Windows Terminal Preview, you might notice a few changes. Now that AtlasEngine is the default text rendering engine for Windows Terminal, we have removed the old DxEngine from Windows Terminal.

We have also added some new settings to let you control the behavior of the AtlasEngine via a setting that allows you to select the Graphics API and a setting to disable partial Swap Chain invalidation.

Image Rendering Settings

Added Support for Custom Box Drawing and Powerline Glyphs

With the AtlasEngine, Windows Terminal can now render pixel-perfect block elements, box-drawing characters, PowerLine symbols, and high-fidelity textured shade glyphs.

This is enabled by default but you can turn it off by disabling “Built-in Glyphs” in the Settings UI (or by going to your settings.json file and setting {profile}.font.builtinGlyphs to false)

Image of block glyphs

IME Integration

We have rewritten our Input Method Editor (IME) integration from the ground up. This new rewrite properly blends into TUI applications by adopting their foreground and background colors. We also now use double underlines, wavy lines, and dashed lines to convey more information than ever before in more languages. Oh, and you can finally move the clause cursor during a composition 🙂

The image below is an example of our IME integration in action:

Image of IME composition

Here is an example of our IME integration blending into a TUI application like FAR Manager:

Second example of IME integration.

Custom Actions in Fragment Extensions

Our JSON Fragment Extensions now support Custom Actions. Here is an example of a Custom Action that you can call.

{
  "schemes": [
    {
      "name": "Dracula",
      "black": "#000000",
      "red": "#ff5555",
      "green": "#50fa7b",
      "yellow": "#f1fa8c",
      "blue": "#bd93f9",
      "purple": "#ff79c6",
      "cyan": "#8be9fd",
      "white": "#bbbbbb",
      "brightBlack": "#555555",
      "brightRed": "#ff5555",
      "brightGreen": "#50fa7b",
      "brightYellow": "#f1fa8c",
      "brightBlue": "#bd93f9",
      "brightPurple": "#ff79c6",
      "brightCyan": "#8be9fd",
      "brightWhite": "#ffffff",
      "background": "#1e1f29",
      "foreground": "#f8f8f2",
      "selectionBackground": "#44475a",
      "cursorColor": "#bbbbbb"
    }
  ],
  "actions": [
    {
      "command": {
        "action": "setColorScheme",
        "colorScheme": "Dracula"
      },
      "name": "Phone up Bram Stoker",
      "id": "Dracula.Draculize"
    }
  ]
}

If you place the snippet as a .json file inside a Fragments folder in %LOCALAPPDATA%\Microsoft\Windows Terminal, then you’ll be able to call a custom action called “Phone Up Bram Stoker” that sets your Color Scheme to the Dracula color scheme.

Shoutout to @DHowett for this example and draculatheme.com for the colorful theme 🧛

Image Custom Action in Fragment Extensions

Scratchpad (Experimental)

We have refactored terminal panes to be able to host non-Terminal content. One application of this refactor is our new, experimental Scratchpad feature. This feature open up a textbox in a separate terminal pane. To enable Scratchpad, add the following as an action in your settings.json file:

{"action":"splitPane","type":"scratchpad"}

After that Action is saved, you can invoke it in your Command Palette (as with every Action you make.) You can also assign a keybinding to that action as well if you do not want to open the Command Palette every time you want to use this Action.

Image Scratchpad

experimental.pixelShaderImagePath Setting

Users can now load up an image as a texture by using the experimental.pixelShaderImagePath setting. Huge shoutout to @mrange for this contribution and example!

In @mrange‘s example below, you can see that the pixelShaderImagePath points to a PNG loaded as a texture which the shader pointed out by pixelShaderPath uses.

"defaults": 
 { 
     "experimental.pixelShaderImagePath": "C:\temp\cake.png", 
     "experimental.pixelShaderPath": "C:\code\github\windows-terminal-shaders\cake.hlsl" 
 },

@mrange‘s final result looks like this:

Image mrange Example of PixelShaders

Usability Updates

⚡ Terminal distributions now come with an additional library, Microsoft.Terminal.UI.dll. Its .winmd is not required.

⚡ Marks are no longer an experimental feature! They also now reflow on resize and clear properly!

⚡ The Pane keybindings Alt+Shift++ and Alt+Shift+- will now duplicate your active profile.

⚡ Terminal will now delete its in-box color schemes from your local settings file, unless you’ve modified them.

⚡ You can no longer edit the color schemes that come with Terminal without copying them.

⚡ We’ve added new color schemes: Dark+, CGA and IBM!

⚡ Profiles now default to the icons of their .exe files, if those can be determined. If you want your profile to have no icon, you must set the icon to "none" (or check the “Hide icon” in Settings)

⚡ The Search box now animates in and out (thanks @tusharsnx!)

⚡ We’ve restyled the Warning and Error displays around the font settings so that they’re more readable.

⚡ We’ve started laying the groundwork for action binding so please be on the lookout for any strangeness!

Bug Fixes

🐛 Double-clicking a word on the left side of the screen will no longer select parts of your right prompt.

🐛 URLs that touch the right side of the screen or get resized are once again clickable

🐛 Double-clicking a word in a double-width or double-height row now actually selects the right word (thanks again @tusharsnx!)

🐛 During RTF export, we will now use a background color directive that Microsoft Word understands (#16035) (thanks yet again @tusharsnx!)

🐛 Our light color schemes no longer have a truly unusable selection highlight color (thanks @uoRetr0!)

🐛 We’ve fixed an issue where hyperlinks are detected in the wrong place if there’s a wide character (thanks @comzyh!)

🐛 You can no longer use the Settings UI to enter an initial size that is out of bounds (thanks @chingucoding!)

🐛 The experimental repositionCursorWithMouse setting now actually works after you’ve scrolled the screen.

🐛 doskey macros finally works on inputs with more than one consecutive space character.

🐛 AtlasEngine will no longer occasionally crash when rendering characters in the Unicode Private Use Area.

Virtual Terminal Compatibility Improvements

Huge thanks to @j4james for his help in the Virtual Terminal space!

🖥️ You can now set the window (tab, pane) title with DECSWT (Set Window Title) in addition to XTerm’s OSC 2

🖥️ We now support DECAUPSS, DECRQUPSS and ACS, which completes the 8-bit interface architecture.

🖥️ DCS sequences that span packets will no longer get sliced in half and–in so being–destroyed.

Performance Improvements

🔥 Search highlighting was rewritten to be more robust, responsive, and performant (thanks again @tusharsnx!)

🔥 The console hosting backend no longer spuriously repaints single characters (thanks yet again @j4james!)

🔥 Moving the cursor around was surprisingly expensive so we reduced the cost of cursor invalidation!

Windows Terminal 1.21 Preview is packed with lots of updates. For a full list of changes and which versions of Windows Terminal those changes were backported to, please visit our page on the Windows Terminal GitHub repository for more information.

Top contributors

We love working with the community and recognizing those who made an impact for each release. Here are the community members who helped out for this one!

Contributors who created the most merged pull requests

🏆 Jvr2022

🏆 tusharsnx

🏆 j4james

Contributors who opened the most non-duplicate issues

🏆 j4james

🏆 Zeroes1

🏆 PhMajerus

Contributors who provided the most comments on pull requests

🏆 tusharsnx

🏆 j4james

🏆 FuegoFro

We would also like to give a special thanks to @hellocharli, @Blake-Madden, @wcruz-br, and @berlintay, for code quality, documentation, repository management, and dependency updates across the board!

Thank you!

We hope you enjoy this release of Windows Terminal 1.21 Preview! More information on these new features can be found on our docs site and if you find any bugs or have feature requests, feel free to file them on GitHub.

If you have any questions you can reach out to Christopher Nguyen (@nguyen_dows) on X (formerly Twitter.)

Thanks again!

2023 Signatures

Author

Christopher Nguyen
Product Manager II, Windows Terminal

2 comments

Discussion is closed. Login to edit/delete existing comments.

  • Mystery Man

    Windows Terminal is one of the few remaining things that makes me feel good about Microsoft.

    Please keep up the good work. 👍

  • Andrew Turrentine

    I like a lot of the changes to the terminal over the last few iterations. Makes me wish it was cross-platform even sometimes to use on my other machines 🙂