Terminal.Gui
2.0.0-pre.103
See the version list below for details.
dotnet add package Terminal.Gui --version 2.0.0-pre.103
NuGet\Install-Package Terminal.Gui -Version 2.0.0-pre.103
<PackageReference Include="Terminal.Gui" Version="2.0.0-pre.103" />
<PackageVersion Include="Terminal.Gui" Version="2.0.0-pre.103" />
<PackageReference Include="Terminal.Gui" />
paket add Terminal.Gui --version 2.0.0-pre.103
#r "nuget: Terminal.Gui, 2.0.0-pre.103"
#addin nuget:?package=Terminal.Gui&version=2.0.0-pre.103&prerelease
#tool nuget:?package=Terminal.Gui&version=2.0.0-pre.103&prerelease
The current, stable, release of Terminal.Gui is v1.x. It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as v2
. Therefore:
v1
is now in maintenance mode, meaning we will accept PRs for v1.x (thedevelop
branch) only for issues impacting existing functionality.- All new development happens on the
v2_develop
branch. See the V2 discussion here. - Developers are encouraged to continue building on v1.x until we announce
v2
is stable.
Terminal.Gui: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
Quick Start
Paste these commands into your favorite terminal on Windows, Mac, or Linux. This will install the Terminal.Gui.Templates, create a new "Hello World" TUI app, and run it.
(Press CTRL-Q
to exit the app)
dotnet new --install Terminal.Gui.templates
dotnet new tui -n myproj
cd myproj
dotnet run
Documentation
- Documentation Home
- Terminal.Gui Overview
- List of Views/Controls
- Conceptual Documentation
- API Documentation
The Documentation matches the most recent Nuget release from the main
branch ()
Features
- Cross Platform - Windows, Mac, and Linux. Terminal drivers for Curses, Windows Console, and the .NET Console mean apps will work well on both color and monochrome terminals.
- Keyboard and Mouse Input - Both keyboard and mouse input are supported, including support for drag & drop.
- Flexible Layout - Supports both Absolute layout and an innovative Computed Layout system. Computed Layout makes it easy to lay out controls relative to each other and enables dynamic terminal UIs.
- Clipboard support - Cut, Copy, and Paste of text provided through the
Clipboard
class. - Arbitrary Views - All visible UI elements are subclasses of the
View
class, and these in turn can contain an arbitrary number of sub-views. - Advanced App Features - The Mainloop supports processing events, idle handlers, timers, and monitoring file descriptors. Most classes are safe for threading.
- Reactive Extensions - Use reactive extensions and benefit from increased code readability, and the ability to apply the MVVM pattern and ReactiveUI data bindings. See the source code of a sample app in order to learn how to achieve this.
Showcase & Examples
- UI Catalog - The UI Catalog project provides an easy to use and extend sample illustrating the capabilities of Terminal.Gui. Run
dotnet run --project UICatalog
to run the UI Catalog. - C# Example - Run
dotnet run
in theExample
directory to run the C# Example. - F# Example - An example showing how to build a Terminal.Gui app using F#.
- Reactive Example - A sample app that shows how to use
System.Reactive
andReactiveUI
withTerminal.Gui
. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUIWhenAnyValue
syntax and Pharmacist — a tool that converts all events in a NuGet package into observable wrappers. - PowerShell's
Out-ConsoleGridView
-OCGV
sends the output from a command to an interactive table. - F7History - Graphical Command History for PowerShell (built on PowerShell's
Out-ConsoleGridView
). - PoshRedisViewer - A compact Redis viewer module for PowerShell written in F#.
- PoshDotnetDumpAnalyzeViewer - dotnet-dump UI module for PowerShell.
- TerminalGuiDesigner - Cross platform view designer for building Terminal.Gui applications.
See the Terminal.Gui/
README for an overview of how the library is structured. The Conceptual Documentation provides insight into core concepts.
Sample Usage in C#
The following example shows a basic Terminal.Gui application in C#:
// A simple Terminal.Gui example in C# - using C# 9.0 Top-level statements
using Terminal.Gui;
Application.Run<ExampleWindow> ();
System.Console.WriteLine ($"Username: {((ExampleWindow)Application.Top).usernameText.Text}");
// Before the application exits, reset Terminal.Gui for clean shutdown
Application.Shutdown ();
// Defines a top-level window with border and title
public class ExampleWindow : Window {
public TextField usernameText;
public ExampleWindow ()
{
Title = "Example App (Ctrl+Q to quit)";
// Create input components and labels
var usernameLabel = new Label () {
Text = "Username:"
};
usernameText = new TextField ("") {
// Position text field adjacent to the label
X = Pos.Right (usernameLabel) + 1,
// Fill remaining horizontal space
Width = Dim.Fill (),
};
var passwordLabel = new Label () {
Text = "Password:",
X = Pos.Left (usernameLabel),
Y = Pos.Bottom (usernameLabel) + 1
};
var passwordText = new TextField ("") {
Secret = true,
// align with the text box above
X = Pos.Left (usernameText),
Y = Pos.Top (passwordLabel),
Width = Dim.Fill (),
};
// Create login button
var btnLogin = new Button () {
Text = "Login",
Y = Pos.Bottom(passwordLabel) + 1,
// center the login button horizontally
X = Pos.Center (),
IsDefault = true,
};
// When login button is clicked display a message popup
btnLogin.Clicked += () => {
if (usernameText.Text == "admin" && passwordText.Text == "password") {
MessageBox.Query ("Logging In", "Login Successful", "Ok");
Application.RequestStop ();
} else {
MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok");
}
};
// Add the views to the Window
Add (usernameLabel, usernameText, passwordLabel, passwordText, btnLogin);
}
}
When run the application looks as follows:
Sample application running
Installing
Use NuGet to install the Terminal.Gui
NuGet package: https://www.nuget.org/packages/Terminal.Gui
Installation in .NET Core Projects
To install Terminal.Gui into a .NET Core project, use the dotnet
CLI tool with this command.
dotnet add package Terminal.Gui
Or, you can use the Terminal.Gui.Templates.
Building the Library and Running the Examples
- Windows, Mac, and Linux - Build and run using the .NET SDK command line tools (
dotnet build
in the root directory). RunUICatalog
withdotnet run --project UICatalog
. - Windows - Open
Terminal.sln
with Visual Studio 2022.
See CONTRIBUTING.md for instructions for downloading and forking the source.
Contributing
See CONTRIBUTING.md.
Debates on architecture and design can be found in Issues tagged with design.
History
See gui-cs for how this project came to be.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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 was computed. 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. |
-
net7.0
- Microsoft.DotNet.PlatformAbstractions (>= 3.1.6)
- System.IO.Abstractions (>= 19.2.51)
- System.Management (>= 7.0.2)
- System.Text.Json (>= 7.0.3)
- Wcwidth (>= 1.0.0)
NuGet packages (25)
Showing the top 5 NuGet packages that depend on Terminal.Gui:
Package | Downloads |
---|---|
HIC.RDMP.Plugin
Core package for plugin development |
|
Carbon.Kit
Provides interfaces, abstractions and common functions which is the essence of Carbon Kit. |
|
FluiTec.AppFx.Console
Package Description |
|
M5x.TermUi
Package Description |
|
Terminal.Gui.Elmish
An elmish wrapper around Miguel de Icaza's 'Gui.cs' https://github.com/migueldeicaza/gui.cs including F# Feliz-like like view DSL. |
GitHub repositories (17)
Showing the top 17 popular GitHub repositories that depend on Terminal.Gui:
Repository | Stars |
---|---|
awaescher/RepoZ
👨💻 A zero-conf git repository hub for Windows and macOS with Windows Explorer- & CLI-enhancements
|
|
PowerShell/ConsoleGuiTools
Modules that mix PowerShell and GUIs/CUIs!
|
|
paillave/Etl.Net
Mass processing data with a complete ETL for .net developers
|
|
Decimation/SmartImage
Reverse image search tool (SauceNao, IQDB, Ascii2D, trace.moe, and more)
|
|
bjorkstromm/depends
Tool for generating dependency trees for .NET projects
|
|
gui-cs/TerminalGuiDesigner
Forms Designer for Terminal.Gui (aka gui.cs)
|
|
NicolasConstant/BirdsiteLive
An ethical bridge from Twitter
|
|
CCob/Volumiser
|
|
Texnomic/SecureDNS
Secure, Modern, Fully-Featured, All-In-One Cross-Architecture & Cross-Platform DNS Server Using .NET 8.0
|
|
PKISharp/ACMESharpCore
An ACME v2 client library for .NET Standard (Let's Encrypt)
|
|
YSGStudyHards/DotNetExercises
⚔【DotNetGuide专栏C#/.NET/.NET Core编程技巧练习集】C#/.NET/.NET Core编程常用语法、算法、技巧、中间件、类库、工作业务实操练习集,配套详细的文章教程讲解,助你快速掌握C#/.NET/.NET Core中各种编程常用语法、算法、技巧、中间件、类库、工作业务实操等等。
|
|
ironmansoftware/psedit
A terminal-based editor for PowerShell
|
|
reactiveui/ReactiveMvvm
Cross-platform ReactiveUI sample app built for a talk at MSK .NET conf.
|
|
migueldeicaza/XtermSharp
XTerm emulator as a .NET library
|
|
mbbsemu/MBBSEmu
The MajorBBS Emulation Project is an Open Source, Cross-Platform emulator for easily running The MajorBBS & Worldgroup Modules
|
|
Draco-lang/Compiler
The compiler repository for the Draco programming language.
|
|
henrikstengaard/hstwb-installer
A set of scripts to automate installation of Amiga OS, Kickstart roms and packages to new or existing Amiga HDF files
|
Version | Downloads | Last updated |
---|---|---|
2.0.0-prealpha.1985 | 0 | 6/1/2025 |
2.0.0-prealpha.1981 | 0 | 6/1/2025 |
2.0.0-prealpha.1964 | 121 | 5/29/2025 |
2.0.0-prealpha.1961 | 105 | 5/29/2025 |
2.0.0-prealpha.1928 | 112 | 5/29/2025 |
2.0.0-develop.4477 | 0 | 6/1/2025 |
2.0.0-develop.4476 | 0 | 6/1/2025 |
2.0.0-develop.4475 | 0 | 6/1/2025 |
2.0.0-develop.4432 | 27 | 5/31/2025 |
2.0.0-develop.4431 | 108 | 5/29/2025 |
2.0.0-develop.4430 | 105 | 5/29/2025 |
1.19.0-develop.16 | 126 | 4/24/2025 |
1.19.0-develop.15 | 120 | 4/24/2025 |
1.18.1 | 2,804 | 4/24/2025 |
1.18.0 | 5,015 | 3/16/2025 |
1.17.1 | 57,486 | 7/11/2024 |
1.16.0 | 39,915 | 3/16/2024 |
1.15.1 | 41,187 | 1/22/2024 |
1.14.1 | 50,264 | 10/30/2023 |
1.13.4 | 1,358 | 7/19/2023 |
1.7.1 | 1,302 | 8/1/2022 |
1.6.3 | 1,063 | 5/27/2022 |
1.2.0 | 1,704 | 8/24/2021 |
1.1.0 | 709 | 5/16/2021 |