System.Terminal is a toolkit for writing terminal-based applications. It is effectively a complete replacement for System.Console.
With the Windows console host now supporting virtual terminal sequences, it makes little sense for console interaction to still be centered around the old Windows console host and the many limitations it had. System.Terminal provides an API centered around an emulated VT100 terminal (with various modern and widely supported extensions) and works on all desktop platforms that .NET 6+ supports.
Please note that, since System.Terminal replaces a very fundamental component of the framework, the use of certain framework APIs becomes problematic. As an example, intermixing System.Terminal and System.Console usage will break. Referencing System.Terminal (or a package that uses it) will pull in a Roslyn analyzer that will diagnose problematic APIs and suggest working replacements.
This project offers the following packages:
- Terminal: Provides the core terminal API.
- Terminal.Hosting: Provides the terminal hosting model.
- Terminal.Extensions: Provides terminal hosting and logging for the .NET Generic Host.
To install a package, run dotnet add package <name>
.
See the sample programs for examples of what the API can do. The
samples can be run with
dotnet example
.
This project aims to have excellent support for the following terminal emulators:
- Alacritty
- ConEmu
- foot
- GNOME Terminal
- iTerm2
- kitty
- Konsole
- mintty
- mlterm
- PuTTY
- rxvt-unicode
- Terminal.app
- Terminology
- WezTerm
- Windows Console
- Windows Terminal
- xterm
(Even if you are using a terminal emulator that is not listed here, chances are
that it will work just fine; these are just the ones that are tested regularly
while developing System.Terminal
.)