MTerminal.Avalonia.Terminal 2.7.8

dotnet add package MTerminal.Avalonia.Terminal --version 2.7.8
                    
NuGet\Install-Package MTerminal.Avalonia.Terminal -Version 2.7.8
                    
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="MTerminal.Avalonia.Terminal" Version="2.7.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MTerminal.Avalonia.Terminal" Version="2.7.8" />
                    
Directory.Packages.props
<PackageReference Include="MTerminal.Avalonia.Terminal" />
                    
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 MTerminal.Avalonia.Terminal --version 2.7.8
                    
#r "nuget: MTerminal.Avalonia.Terminal, 2.7.8"
                    
#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 MTerminal.Avalonia.Terminal@2.7.8
                    
#: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=MTerminal.Avalonia.Terminal&version=2.7.8
                    
Install as a Cake Addin
#tool nuget:?package=MTerminal.Avalonia.Terminal&version=2.7.8
                    
Install as a Cake Tool

Iciclecreek.Avalonia.Terminal For Avalonia 12.x

Terminal Demo

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

Build Status NuGet License

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
StartingDirectory string? Current working directory The initial working directory used when launching the PTY process
CurrentDirectory string? Read-only The current working directory reported by the running terminal session via OSC 7
ExitCode int Read-only The exit code of the launched process after it has terminated
Pid int Read-only The operating system process identifier of the launched terminal 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

Methods:

Method Description
LaunchProcess() Launches the configured Process with the current Args and StartingDirectory
LaunchProcess(string? startingDirectory, string process, params string[] args) Convenience overload that sets StartingDirectory, Process, and Args, then launches the process
Kill() Terminates the running terminal process
WaitForExit(int ms) Waits for the terminal process to exit or for the specified timeout to elapse

Events:

Event Description
ProcessExited Raised when the PTY process exits. The handler receives ProcessExitedEventArgs with the process ExitCode.

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,
    StartingDirectory = Environment.CurrentDirectory,
    Process = "pwsh.exe",  // PowerShell Core
    Args = new[] { "-NoLogo" },
    CloseOnProcessExit = true
};

terminalWindow.Show();

Methods:

Method Description
LaunchProcess() Launches the configured Process with the current Args and StartingDirectory
LaunchProcess(string? startingDirectory, string process, params string[] args) Convenience overload that sets StartingDirectory, Process, and Args, then launches the process
Kill() Terminates the running terminal process
WaitForExit(int ms) Waits for the terminal process to exit or for the specified timeout to elapse

Additional Properties (beyond TerminalControl):

Property Type Default Description
ExitCode int Read-only The exit code of the launched process after it has terminated
Pid int Read-only The operating system process identifier of the launched terminal process
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

Events:

Event Description
ProcessExited Raised when the PTY process exits. The handler receives ProcessExitedEventArgs with the process ExitCode. If CloseOnProcessExit is true, the event is raised before the window closes.

License

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

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
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
2.7.8 0 7/7/2026
2.7.7 7 7/6/2026
2.7.6 48 7/6/2026
2.7.5 50 7/6/2026
2.7.4 45 7/5/2026
2.7.2 72 7/1/2026
2.7.0 50 7/1/2026
2.6.0 52 7/1/2026
2.5.0 135 6/25/2026
2.4.0 101 6/25/2026
2.3.0 118 6/25/2026
2.2.0 109 6/24/2026
2.1.0 114 6/23/2026