Terminal.Gui

tui-csMIT活跃维护

一套跨平台的 .NET 终端 UI 工具包,用 C# 就能搭建带窗口、按钮和布局的字符界面应用,省去自己处理 curses 底层细节的麻烦。

Cross Platform Terminal UI toolkit for .NET

v2.5.0发布于 2026-09-11 12:18 UTC11,307star +2 / 7 天793fork同步于 2026-11-10 11:28 UTC

怎么上手

由 README 提炼,执行前请确认
dotnet add package Terminal.Gui
dotnet new install Terminal.Gui.Templates
硬件要求按 README 说明

README 未说明;仅要求 Windows、macOS 或 Linux/Unix 上的 .NET 运行环境,无 GPU 或显存要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 .NET 的跨平台终端 UI 工具包,用布局系统和内置控件快速搭建复杂 TUI 应用

一套跨平台的 .NET 终端 UI 工具包,用 C# 就能搭建带窗口、按钮和布局的字符界面应用,省去自己处理 curses 底层细节的麻烦。

核心能力

  • 用响应式布局系统构建可自适应的终端界面
  • 双缓冲渲染,表格与树视图支持无限元素和排序过滤
  • 内置 50+ 视图控件,含文本编辑器、表格、图表、向导
  • 支持键盘优先操作,同时提供完整鼠标支持
  • 应用可内联滚动显示或全屏运行,主题与键位可持久化配置

容易踩的坑

v2 与 v1 的 API 不兼容,从 v1 升级需按迁移指南改造代码;模板需先通过 dotnet new install 单独安装才能使用 tui-simple 等模板;仓库内示例已部分迁移到独立示例仓库,Examples 目录可能不完整。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.5.0
  1. 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.

    1. View.Text is no longer virtual (#5371 / #5366)

      • Use OnTextChanging(string proposedValue) / TextChanging to validate or cancel.
      • Use OnTextChanged() for post-change sync.
      • TextField uses View.Text directly (no new hider).
    2. IAcceptTarget moved to Terminal.Gui.Input (#5395 / #5369)

      • Add using Terminal.Gui.Input;.
    3. Legacy ConfigurationManager removed (#5416 / #4367)

      • Replacement: TuiConfigurationBuilder and Settings POCOs (ButtonSettings.Current, etc.).
      • config.json is nested only. Convert old flat-key files with Tools/MigrateConfig.
      • Types marked [Obsolete] in 2.4.17 (#5411) are gone.

    See docfx/docs/breaking-changes-2.5.0.md and 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

  2. 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.

    1. View.Text is no longer virtual (#5371 / #5366)

      • Use OnTextChanging(string proposedValue) / TextChanging to validate or cancel.
      • Use OnTextChanged() for post-change sync.
      • TextField uses View.Text directly (no new hider).
    2. IAcceptTarget moved to Terminal.Gui.Input (#5395 / #5369)

      • Add using Terminal.Gui.Input;.
    3. Legacy ConfigurationManager removed (#5416 / #4367)

      • Replacement: TuiConfigurationBuilder and Settings POCOs (ButtonSettings.Current, etc.).
      • config.json is nested only. Convert old flat-key files with Tools/MigrateConfig.
      • Types marked [Obsolete] in 2.4.17 (#5411) are gone.

    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

    What's Changed

  3. v2.4.172026-07-07 · 2026-07-07 12:20 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/tui-cs/Terminal.Gui/compare/v2.4.16...v2.4.17

  4. v2.4.162026-06-28 · 2026-06-28 19:42 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/tui-cs/Terminal.Gui/compare/v2.4.15...v2.4.16

  5. v2.4.152026-06-28 · 2026-06-28 17:18 UTC
    查看更新说明

    Release v2.4.15

    Stable release from main. Promotes the validated v2.4.14-beta.1 content 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.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    NuGet Version Bugs codecov Downloads

    Terminal.Gui

    Cross-platform UI toolkit for building sophisticated terminal UI (TUI) applications on Windows, macOS, and Linux/Unix.

    Terminal.Gui — cross-platform TUI toolkit for .NET. Build full-featured terminal UIs with menus, forms, tables, charts, wizards and file dialogs. +11k stars, +50 built-in views, +1.7M downloads, TrueColor with Unicode and mouse — Windows / macOS / Linux, MIT-licensed.

    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

    Migration & Deep Dives

    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

    JetBrains logo.

    Contributing

    Contributions welcome! See CONTRIBUTING.md.

    History

    See tui-cs for project history and origins.