Skip to main content
net6.0

Avalonia terminal controls (TerminalControl/TerminalWindow) that provide an XTerm console for hosting console applications in Avalonia.

Published
Dec 29, 2025
9mo ago
Total Downloads
18.1K
18,110

Install

dotnet add package Iciclecreek.Avalonia.Terminal --version 1.0.1
ProductVersions
.NET
net6.0

README

Iciclecreek.Avalonia.Terminal

A cross-platform XTerm terminal emulator control for Avalonia UI applications.

NuGet License Build Status

Introduction

Iciclecreek.Avalonia.Terminal provides Avalonia controls for embedding a fully-featured terminal emulator in your cross-platform desktop applications. Built on top of XTerm.NET for terminal emulation and Porta.Pty for pseudo-terminal support, it offers:

  • Full XTerm-compatible terminal emulation
  • Cross-platform support (Windows, Linux, macOS)
  • Scrollback buffer with configurable size
  • Text selection and clipboard support
  • Terminal window manipulation commands (resize, move, minimize, maximize, etc.)
  • Dynamic title updates from terminal escape sequences
  • Customizable fonts, colors, and styling

Installation

Install via NuGet Package Manager:

dotnet add package Iciclecreek.Avalonia.Terminal

Or via the Package Manager Console in Visual Studio:

Install-Package Iciclecreek.Avalonia.Terminal

Usage

TerminalControl

TerminalControl is a templated control that provides a terminal view with an integrated scrollbar. Use this when you want to embed a terminal within your own window or layout.

XAML:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:terminal="using:Iciclecreek.Terminal"
        x:Class="MyApp.MainWindow">
    
    <terminal:TerminalControl x:Name="Terminal"
                              FontFamily="Cascadia Mono"
                              FontSize="14"
                              BufferSize="1000"
                              ProcessExited="OnProcessExited"/>
</Window>

Code-behind:

using Avalonia.Controls;
using Iciclecreek.Terminal;

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void OnProcessExited(object? sender, ProcessExitedEventArgs e)
    {
        // Handle process exit (e.g., close window)
        Close();
    }
}

Properties:

Property Type Default Description
Process string cmd.exe (Windows) / sh (Unix) The shell or process to launch
Args IList<string> Empty Command-line arguments for the process
BufferSize int 1000 Scrollback buffer size (number of lines)
FontFamily FontFamily Inherited Terminal font family (use monospace fonts)
FontSize double Inherited Terminal font size
Foreground IBrush Inherited Default text color
Background IBrush Inherited Terminal background color
SelectionBrush IBrush Semi-transparent blue Text selection highlight color

Events:

Event Description
ProcessExited Raised when the PTY process exits
TitleChanged Raised when the terminal title changes (via escape sequences)
BellRang Raised when the terminal bell is activated
WindowMoved Raised when a window move command is received
WindowResized Raised when a window resize command is received
WindowMinimized Raised when a minimize command is received
WindowMaximized Raised when a maximize command is received
WindowRestored Raised when a restore command is received
WindowFullscreened Raised when a fullscreen command is received

TerminalWindow

TerminalWindow is a complete window implementation that automatically handles terminal events like title changes and window manipulation commands. Use this when you want a standalone terminal window.

XAML:

<terminal:TerminalWindow xmlns="https://github.com/avaloniaui"
                         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                         xmlns:terminal="using:Iciclecreek.Terminal"
                         x:Class="MyApp.TerminalWindow"
                         Title="Terminal"
                         Width="800"
                         Height="600"
                         FontFamily="Consolas"
                         FontSize="12"
                         Background="Black"
                         Foreground="White"
                         CloseOnProcessExit="True"
                         UpdateTitleFromTerminal="True"
                         HandleWindowCommands="True"/>

Or create programmatically:

using Iciclecreek.Terminal;

var terminalWindow = new TerminalWindow
{
    Title = "My Terminal",
    Width = 800,
    Height = 600,
    FontFamily = new FontFamily("Cascadia Mono"),
    FontSize = 14,
    Process = "pwsh.exe",  // PowerShell Core
    Args = new[] { "-NoLogo" },
    CloseOnProcessExit = true
};

terminalWindow.Show();

Additional Properties (beyond TerminalControl):

Property Type Default Description
CloseOnProcessExit bool true Automatically close the window when the process exits
UpdateTitleFromTerminal bool true Update window title from terminal escape sequences
HandleWindowCommands bool true Handle window manipulation commands from the terminal

Links

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changes from Previous Version

v1.0.0v1.0.1
Added Frameworks
net6.0
Removed Frameworks
net10.0
Added Dependencies
Removed Dependencies
Avalonia(net10.0)
Porta.Pty(net10.0)
Unicode.net(net10.0)
Wcwidth(net10.0)
XTerm.NET(net10.0)

Adoption Assessment

Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.

Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.