v2 与 v1 的 API 不兼容,从 v1 升级需按迁移指南改造代码;模板需先通过 dotnet new install 单独安装才能使用 tui-simple 等模板;仓库内示例已部分迁移到独立示例仓库,Examples 目录可能不完整。
Terminal.Gui
tui-csMIT活跃维护一套跨平台的 .NET 终端 UI 工具包,用 C# 就能搭建带窗口、按钮和布局的字符界面应用,省去自己处理 curses 底层细节的麻烦。
Cross Platform Terminal UI toolkit for .NET
dotnet add package Terminal.Gui
dotnet new install Terminal.Gui.TemplatesREADME 未说明;仅要求 Windows、macOS 或 Linux/Unix 上的 .NET 运行环境,无 GPU 或显存要求。
基于 .NET 的跨平台终端 UI 工具包,用布局系统和内置控件快速搭建复杂 TUI 应用
一套跨平台的 .NET 终端 UI 工具包,用 C# 就能搭建带窗口、按钮和布局的字符界面应用,省去自己处理 curses 底层细节的麻烦。
核心能力
- 用响应式布局系统构建可自适应的终端界面
- 双缓冲渲染,表格与树视图支持无限元素和排序过滤
- 内置 50+ 视图控件,含文本编辑器、表格、图表、向导
- 支持键盘优先操作,同时提供完整鼠标支持
- 应用可内联滚动显示或全屏运行,主题与键位可持久化配置
容易踩的坑
- v2.5.0最新正式版2026-09-11 · 2026-09-11 12:18 UTC
Breaking changes
This is a minor bump because v2 still accepts planned API breaks. Apps that compiled against 2.4.17 may need source changes.
-
View.Textis no longer virtual (#5371 / #5366)- Use
OnTextChanging(string proposedValue)/TextChangingto validate or cancel. - Use
OnTextChanged()for post-change sync. TextFieldusesView.Textdirectly (nonewhider).
- Use
-
IAcceptTargetmoved toTerminal.Gui.Input(#5395 / #5369)- Add
using Terminal.Gui.Input;.
- Add
-
Legacy
ConfigurationManagerremoved (#5416 / #4367)- Replacement:
TuiConfigurationBuilderand Settings POCOs (ButtonSettings.Current, etc.). config.jsonis nested only. Convert old flat-key files withTools/MigrateConfig.- Types marked
[Obsolete]in 2.4.17 (#5411) are gone.
- Replacement:
See
docfx/docs/breaking-changes-2.5.0.mdand the configuration deep dive.Highlights
- Editable NumericUpDown
- TableView horizontal scrolling for wide content
- Native ANSI size detection; platform detection cleanup
- SynchronizationContext fix
- Kitty protocol: preserve repeated legacy input after detection
- DropDownList: hide active popover on DeRegister (#5635)
- NativeAOT: RuneJsonConverter no longer trips IL2026 (#5659)
What's Changed
- Back-merge v2.4.17 from main into develop by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5586
- Fixes #5469 - Add editable text mode to NumericUpDown by @tig with @Copilot in https://github.com/tui-cs/Terminal.Gui/pull/5587
- Fixes #5579. SynchronizationContext is not correctly implemented in v2 by @BDisp in https://github.com/tui-cs/Terminal.Gui/pull/5588
- Bump GitVersion.MsBuild from 6.8.1 to 6.8.2 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5589
- Bump Serilog from 4.3.1 to 4.4.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5590
- Bump System.IO.Abstractions from 22.1.1 to 22.2.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5591
- Bump Microsoft.NET.Test.Sdk from 18.7.0 to 18.8.1 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5593
- Bump Microsoft.Extensions.Configuration and Microsoft.Extensions.Configuration.Binder by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5595
- Bump TestableIO.System.IO.Abstractions.TestingHelpers from 22.1.1 to 22.2.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5592
- Bump actions/setup-dotnet from 5 to 6 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5598
- Bump Microsoft.Extensions.Options from 10.0.9 to 10.0.10 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5597
- Bump actions/setup-go from 6 to 7 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5599
- Fixes #5604 - Fix and simplify platform detection by @kasperk81 in https://github.com/tui-cs/Terminal.Gui/pull/5600
- ci: read the release branch name from env instead of interpolating it by @kobihikri in https://github.com/tui-cs/Terminal.Gui/pull/5603
- Bump Microsoft.Extensions.Configuration.Json from 10.0.7 to 10.0.10 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5605
- Fix TIOCGWINSZ on other platforms by @kasperk81 in https://github.com/tui-cs/Terminal.Gui/pull/5610
- Bump Microsoft.Extensions.Configuration and Microsoft.Extensions.Configuration.Binder by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5612
- Bump Microsoft.Extensions.Options from 10.0.10 to 10.0.11 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5614
- Bump Microsoft.NET.Test.Sdk from 18.8.1 to 18.9.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5621
- Bump Microsoft.Net.Compilers.Toolset from 5.6.0 to 5.9.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5626
- Fixes #5468. Fix TextValidateField cursor rendering by @lyrae-versebound in https://github.com/tui-cs/Terminal.Gui/pull/5620
- Fixes #5601. Synchronize dirty-row flags after
-
- v2.5.0-beta.1pre-release2026-09-03 · 2026-09-03 20:48 UTC
查看更新说明
Breaking changes
This is a beta pre-release of a minor bump. v2 still accepts planned API breaks. Apps that compiled against 2.4.17 may need source changes.
-
View.Textis no longer virtual (#5371 / #5366)- Use
OnTextChanging(string proposedValue)/TextChangingto validate or cancel. - Use
OnTextChanged()for post-change sync. TextFieldusesView.Textdirectly (nonewhider).
- Use
-
IAcceptTargetmoved toTerminal.Gui.Input(#5395 / #5369)- Add
using Terminal.Gui.Input;.
- Add
-
Legacy
ConfigurationManagerremoved (#5416 / #4367)- Replacement:
TuiConfigurationBuilderand Settings POCOs (ButtonSettings.Current, etc.). config.jsonis nested only. Convert old flat-key files withTools/MigrateConfig.- Types marked
[Obsolete]in 2.4.17 (#5411) are gone.
- Replacement:
See Breaking changes 2.5.0 and Migrating ConfigurationManager to TuiConfigurationBuilder.
Highlights
- Editable NumericUpDown
- TableView horizontal scrolling for wide content
- Native ANSI size detection; platform detection cleanup
- SynchronizationContext fix
- Kitty protocol: preserve repeated legacy input after detection
- DropDownList: hide active popover on DeRegister (stale cells, #5635)
- NativeAOT: RuneJsonConverter no longer trips IL2026
Auto-generated
Breaking Changes
- Fixes #5369 - BREAKING CHANGE - Move IAcceptTarget to Terminal.Gui.Input namespace by @tig with @Copilot in https://github.com/tui-cs/Terminal.Gui/pull/5395
- Fixes #5366 - BREAKING CHANGE - Make View.Text notifications CWP-compliant and non-virtual by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5371
- FIXES #4367 - BREAKING CHANGE - Remove legacy ConfigurationManager after MEC migration by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5416
What's Changed
- Back-merge v2.4.17 from main into develop by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5586
- Fixes #5469 - Add editable text mode to NumericUpDown by @tig with @Copilot in https://github.com/tui-cs/Terminal.Gui/pull/5587
- Fixes #5579. SynchronizationContext is not correctly implemented in v2 by @BDisp in https://github.com/tui-cs/Terminal.Gui/pull/5588
- Bump GitVersion.MsBuild from 6.8.1 to 6.8.2 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5589
- Bump Serilog from 4.3.1 to 4.4.0 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5590
- Bump System.IO.Abstractions from 22.1.1 to 22.2.0 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5591
- Bump Microsoft.NET.Test.Sdk from 18.7.0 to 18.8.1 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5593
- Bump Microsoft.Extensions.Configuration and Microsoft.Extensions.Configuration.Binder by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5595
- Bump TestableIO.System.IO.Abstractions.TestingHelpers from 22.1.1 to 22.2.0 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5592
- Bump actions/setup-dotnet from 5 to 6 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5598
- Bump Microsoft.Extensions.Options from 10.0.9 to 10.0.10 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5597
- Bump actions/setup-go from 6 to 7 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5599
- Fixes #5604 - Fix and simplify platform detection by @kasperk81 in https://github.com/tui-cs/Terminal.Gui/pull/5600
- ci: read the release branch name from env instead of interpolating it by @kobihikri in https://github.com/tui-cs/Terminal.Gui/pull/5603
- Bump Microsoft.Extensions.Configuration.Json from 10.0.7 to 10.0.10 by @dependabot in https://github.com/tui-cs/Terminal.Gui/pull/5605
- Fix TIOCGWINSZ on other platforms by @kasperk81 in https://github.com/tui-cs/Terminal.Gui/pull/5610
- Bump Microsoft.Extensions.Configuration and Microsoft.Extensions.Configura
-
- v2.4.172026-07-07 · 2026-07-07 12:20 UTC
查看更新说明
What's Changed
- Back-merge v2.4.16 from main into develop by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5564
- Fixes #5544 #issuecomment-4836836706. FileDialog/OpenDialog: one unre… by @BDisp in https://github.com/tui-cs/Terminal.Gui/pull/5569
- Bump GitVersion.MsBuild from 6.7.0 to 6.8.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5571
- Bump Microsoft.Extensions.Options from 10.0.7 to 10.0.9 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5568
- Bump GitVersion.MsBuild from 6.8.0 to 6.8.1 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5572
- Bump Microsoft.Net.Compilers.Toolset from 5.3.0 to 5.6.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5575
- Bump Spectre.Console from 0.57.1 to 0.57.2 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5576
- Bump gittools/actions from 4.5.0 to 4.7.0 by @dependabot[bot] in https://github.com/tui-cs/Terminal.Gui/pull/5578
- Fixes FileDialog hiding hidden/system entries (dotfiles) after IgnoreInaccessible change by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5581
- Kh/5498 width height event contract by @harder in https://github.com/tui-cs/Terminal.Gui/pull/5577
- Fixes IsReparsePoint fail-open and PopoverMenu.DefaultKey binding collision (release v2.4.17 blockers) by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5583
- Release v2.4.17 by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5584
Full Changelog: https://github.com/tui-cs/Terminal.Gui/compare/v2.4.16...v2.4.17
- v2.4.162026-06-28 · 2026-06-28 19:42 UTC
查看更新说明
What's Changed
- Back-merge v2.4.14-beta.1 from main into develop by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5558
- Fixes #5499. Skip SetNeedsLayout when Dim.Auto text recompute yields unchanged size by @harder in https://github.com/tui-cs/Terminal.Gui/pull/5549
- Remove legacy "Create Release" workflow (release.yml) by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5560
- Fixes #5561 - Make TuiConfigurationBuilder flat-key binding trim/AOT-safe by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5562
- Release v2.4.16 by @tig in https://github.com/tui-cs/Terminal.Gui/pull/5563
Full Changelog: https://github.com/tui-cs/Terminal.Gui/compare/v2.4.15...v2.4.16
- v2.4.152026-06-28 · 2026-06-28 17:18 UTC
查看更新说明
Release v2.4.15
Stable release from
main. Promotes the validatedv2.4.14-beta.1content to stable, including the ConfigurationManager → MEC migration (#5411) with the code-review fixes (flat-key/scalar-Theme MEC binding and the MecThemeManager static-event leak).- Version: 2.4.15
- Type: stable
The package is published to NuGet.org via the publish workflow.
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Terminal.Gui
Cross-platform UI toolkit for building sophisticated terminal UI (TUI) applications on Windows, macOS, and Linux/Unix.

Terminal.Gui enables building sophisticated console applications with modern UIs
- Responsive TUI - Easy to use, innovative, layout system enables console apps as responsive as any responsive web page.
- Performant and Scalable - Built for modern TUIs - fast, double-buffering-based rendering; Tables and Tree Views scale to infinite elements with sorting and filtering.
- Keyboard First; Mouse First Too - Optimized for TUI experiences where the user's hands never need to leave the keyboard; full mouse support too.
- Rich Built-in Widgets (Views) - Text editors, buttons, checkboxes, trees, tables, markdown, linear ranges, menus, selectors, and more.
- Visualizations - Charts, graphs, progress indicators, and color pickers with TrueColor support.
- Text Editors - Full-featured text editing with clipboard, undo/redo, and Unicode support
- Fully Configurable - Themes, colors, key bindings, and settings are all customizable and persistable.
- File Management - File and directory browsers with search and filtering, supporting Nerdfonts and coloring.
- Wizards and Multi-Step Processes - Guided workflows with navigation and validation.
- Cross-Platform - Consistent experience on Windows, macOS, and Linux.
- Apps Work In-line or Full Screen - Build CLI tools like Claude Code/Copilot/Codex CLI that scroll with the terminal (in-line) or full screen.
See the Views Overview for available controls and What's New in v2 for architectural improvements.
Quick Start
Install the Terminal.Gui.Templates, create a new TUI app, and run it:
dotnet new install Terminal.Gui.Templates
dotnet new tui-simple -n myproj
cd myproj
dotnet run
Run the comprehensive UI Catalog demo to explore all controls:
dotnet run --project Examples/UICatalog/UICatalog.csproj
Simple Example
using Terminal.Gui.App;
using Terminal.Gui.ViewBase;
using Terminal.Gui.Views;
using IApplication app = Application.Create ();
app.Init ();
using Window window = new () { Title = "Hello World (Esc to quit)" };
Label label = new ()
{
Text = "Hello, Terminal.Gui v2!",
X = Pos.Center (),
Y = Pos.Center ()
};
window.Add (label);
app.Run (window);
See Examples/README.md for details about the in-repository examples and links to the moved examples repository.
Showcase
See the Showcase for applications built with Terminal.Gui.
Documentation
Comprehensive documentation is at tui-cs.github.io/Terminal.Gui.
Getting Started
- Getting Started Guide - First Terminal.Gui application
- API Reference - Complete API documentation
- What's New in v2 - New features and improvements
Migration & Deep Dives
- Migrating from v1 to v2 - Complete migration guide
- Application Architecture - Instance-based model and IRunnable pattern
- Layout System - Positioning, sizing, and adornments
- Keyboard Handling - Key bindings and commands
- View Documentation - View hierarchy and lifecycle
- Configuration - Themes and persistent settings
See the documentation index for all topics.
Installing
dotnet add package Terminal.Gui
Or use the Terminal.Gui.Templates:
dotnet new install Terminal.Gui.Templates
Powered by
Contributing
Contributions welcome! See CONTRIBUTING.md.
History
See tui-cs for project history and origins.