LoomTerminal.WinUI 0.2.0

dotnet add package LoomTerminal.WinUI --version 0.2.0
                    
NuGet\Install-Package LoomTerminal.WinUI -Version 0.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="LoomTerminal.WinUI" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LoomTerminal.WinUI" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="LoomTerminal.WinUI" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add LoomTerminal.WinUI --version 0.2.0
                    
#r "nuget: LoomTerminal.WinUI, 0.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package LoomTerminal.WinUI@0.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=LoomTerminal.WinUI&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=LoomTerminal.WinUI&version=0.2.0
                    
Install as a Cake Tool

LoomTerminal.WinUI

A native WinUI 3 terminal control (Win2D drawing, no WebView2), Native AOT compatible. The control contains no terminal logic: it forwards input to a TerminalSession (from LoomTerminal.Presentation) and draws its frames.

Install

dotnet add package LoomTerminal.WinUI --prerelease

--prerelease is needed while the version has a suffix (for example 0.1.0-alpha.1). Windows App SDK 2.5.1 and Win2D come transitively. The app must be an unpackaged or packaged WinUI 3 app targeting net11.0-windows10.0.26100.0 or later.

Use it in XAML

<Page xmlns:lt="using:LoomTerminal.WinUI.Controls" ...>
    <lt:TerminalControl x:Name="Terminal" CursorBlink="True" CursorStyle="Bar" LineHeight="1.15" />
</Page>

Start a session

using LoomTerminal.Pty;
using LoomTerminal.Presentation.Session;

ShellInfo shell = Shells.Detect()[0];
Terminal.Session = TerminalSession.Start(new PtyStartOptions(shell.CommandLine));

// The session owns the shell: dispose it (this kills the shell) when the tab or window closes.
Terminal.Session = null;
session.Dispose();

Setting Session attaches the control to the session (theme, cursor and size settings are applied to it). The control resizes the session (Columns, Rows) from its own size and DPI.

Theme and settings

Theme is a TerminalTheme (background, foreground, cursor, selection, 16 ANSI colors; string? CSS colors). Assign a new instance to change it live, for example when the app switches between light and dark:

Terminal.Theme = Terminal.Theme with { Background = "#1e1e1e", Foreground = "#d4d4d4" };

Other dependency properties: CursorBlink, CursorStyle, LineHeight.

Fonts

FontFamily takes a comma-separated list ("Cascadia Mono, Segoe UI Emoji"): the first installed family draws the grid, and each non-ASCII grapheme is drawn with the first listed family that has a glyph for it. Nerd Font icons (oh-my-posh, starship) come from any installed Nerd Font, even when the primary family is plain Cascadia Mono; no font is bundled, so without one they show as missing-glyph boxes. FontWeight, FontSize and LineHeight apply live. Fonts installed while the app runs are seen after a restart.

To use the font of the user's Windows Terminal default profile, call WindowsTerminalFont.Read() (LoomTerminal.Presentation.Rendering) and apply the result (Families joined with ", ", Size in DIPs, Weight). It reads another application's settings file, so the control never calls it: a host opts in explicitly. Without a readable file it returns Windows Terminal's defaults (Cascadia Mono, 12 pt, regular).

Events

All events are raised on the UI thread (they are marshaled from the session's parser thread).

Event Meaning
TitleChanged (string) The shell set the window title (OSC 0/2)
Exited (int) The shell exited, with its exit code
BellRang BEL received
LinkActivated (LinkActivatedEventArgs) Ctrl+click on a link; set Handled to open it yourself
KeyPreview (KeyPreviewEventArgs) Before a key is encoded; set Handled to claim a shortcut

Packages

Four packages share one version (VersionPrefix + VersionSuffix in Directory.Build.props):

LoomTerminal.WinUI ──> LoomTerminal.Presentation ──> LoomTerminal.Core
        │                        └─────────────────> LoomTerminal.Pty
        ├──> Microsoft.WindowsAppSDK
        └──> Microsoft.Graphics.Win2D

They are built into artifacts/packages (.nupkg and .snupkg) by ./eng/Pack.ps1. Tagged releases are published to nuget.org by the release workflow (docs/RELEASING.md). To build and check them locally:

./eng/Pack.ps1

Native AOT notes

  • Publish with dotnet publish -c Release -r win-x64 (needs the Visual Studio "Desktop development with C++" workload). No reflection is used by the control.
  • PRI workaround. With Windows App SDK 2.5.1 and PublishAot=true, the app's .pri file is dropped from the publish folder and the app crashes at startup ("Cannot locate resource from 'ms-appx:///MainWindow.xaml'"). The package ships buildTransitive/LoomTerminal.WinUI.targets, imported automatically into every app that references it, which adds the PRI file back to the publish list. Nothing to do on your side; it will be removed once fixed upstream (see docs/adr/0001-baseline.md, "Known issues").
  • With .NET SDK 11 rc.2, an app that publishes with PublishAot=true may need <UseOptimizedPublish>false</UseOptimizedPublish> (error WMC1007 otherwise, see the Gallery project).

Known limitations

  • Windows only (Avalonia is planned). IME composition needs Windows 11.
  • Rendering performance has only been measured partially (docs/performance.md, follow-up card P4-19).
  • The Gallery manual checklist (docs/manual-tests.md) has not been fully ticked on the AOT build yet.
Product Compatible and additional computed target framework versions.
.NET net11.0-windows10.0.26100 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 835 11/5/2026
0.1.0-alpha.2 381 10/26/2026
0.1.0-alpha.1 100 10/23/2026