mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
6d53276be2c703624b87fc2a0b79492608d3b8b4
* Initial plan * Delete AnsiColorNameResolver and MultiStandardColorNameResolver, add legacy 16-color names to StandardColor Co-authored-by: tig <585482+tig@users.noreply.github.com> * Refactor and enhance tests for Color, Region, and Lines Refactored `Color` struct by removing unused methods and simplifying logic. Updated namespaces for better organization. Enhanced test coverage for `Color`, `Region`, and `LineCanvas` with new test cases, parameterized tests, and edge case handling. Added `StraightLineExtensionsTests`, `StraightLineTests`, and `RegionClassTests` to validate behavior under various scenarios. Improved `MergeRectangles` stability and addressed crash patterns. Removed legacy features and unused code. Enhanced documentation and optimized performance in key methods. * Improve Color struct and StandardColors functionality Enhanced the Color struct to fully support the alpha channel for rendering intent while maintaining semantic color identity. Updated TryNameColor to ignore alpha when matching colors, ensuring transparency does not affect color resolution. Expanded XML documentation to clarify alpha channel usage and future alpha blending support. Improved drawing documentation to explain the lifecycle, deferred rendering, and color support, including 24-bit true color and legacy 16-color compatibility. Added a new section on transparency and its role in rendering. Revised StandardColors implementation to use modern C# features and ensure consistent ARGB mapping. Added comprehensive tests for StandardColors and Color, covering alpha handling, color parsing, thread safety, and aliased color resolution. Removed outdated tests relying on legacy behavior. Enhanced code readability, maintainability, and test coverage to ensure correctness and backward compatibility. * Code cleanup * Code cleanup * Fix warnings. Code cleanup * Add comprehensive unit tests for ColorStrings class Introduced a new test class `ColorStringsTests` under the `DrawingTests.ColorTests` namespace to validate the functionality of the `ColorStrings` class. Key changes include: - Added tests for `GetColorName` to verify behavior for standard and non-standard colors, ignoring alpha channels, and handling known colors. - Added tests for `GetStandardColorNames` to ensure the method returns a non-empty, alphabetically sorted collection containing all `StandardColor` enum values. - Implemented tests for `TryParseStandardColorName` to validate case-insensitive parsing, hex color support, handling invalid input, and `ReadOnlySpan<char>` compatibility. - Added tests for `TryParseNamedColor` to verify parsing of named and hex colors, handling of aliases, and `ReadOnlySpan<char>` support. - Added round-trip tests to ensure consistency between `GetColorName`, `TryParseNamedColor`, `GetStandardColorNames`, and `TryParseStandardColorName`. These tests ensure robust validation of color parsing and naming functionality. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tig <585482+tig@users.noreply.github.com> Co-authored-by: Tig <tig@users.noreply.github.com>
Fixes #4289 - Simplify Drawing/Color: unify named color handling under StandardColor and remove layered resolvers (#4432)
Fixes #4289 - Simplify Drawing/Color: unify named color handling under StandardColor and remove layered resolvers (#4432)
Fixes #4289 - Simplify Drawing/Color: unify named color handling under StandardColor and remove layered resolvers (#4432)
Fixes #4289 - Simplify Drawing/Color: unify named color handling under StandardColor and remove layered resolvers (#4432)
Fixes #4332 - Refactor test infrastructure to use modern ApplicationImpl.Coordinator instead of legacy MainLoop (#4335)
Fixes #4410, #4413, #4414, #4415 -
MessageBox nullable, Clipboard refactor, fence for legacy/modern App, and makes internal classes thread safe. (#4411)
Fixes #4332 - Refactor test infrastructure to use modern ApplicationImpl.Coordinator instead of legacy MainLoop (#4335)
#4329—Major Terminal.Gui v2 Architecture Modernization: Application Decoupling, Terminology Improvements, and Nullable Migration (#4338)
Fixes #4387. Runes should not be used on a cell, but rather should use a single grapheme rendering 1 or 2 columns (#4388)
…
#4329—Major Terminal.Gui v2 Architecture Modernization: Application Decoupling, Terminology Improvements, and Nullable Migration (#4338)
#4329—Major Terminal.Gui v2 Architecture Modernization: Application Decoupling, Terminology Improvements, and Nullable Migration (#4338)
Fixes #4289 - Simplify Drawing/Color: unify named color handling under StandardColor and remove layered resolvers (#4432)
Terminal.Gui v2
Cross-platform UI toolkit for building sophisticated terminal UI (TUI) applications on Windows, macOS, and Linux/Unix.
Important:
- v1 is in maintenance mode - only critical bug fixes accepted
- v2 Alpha is recommended for new projects - API is stable with comprehensive features
- Breaking changes possible before Beta, but core architecture is solid
Quick Start
Install the Terminal.Gui.Templates, create a new TUI app, and run it:
dotnet new --install Terminal.Gui.templates
dotnet new tui -n myproj
cd myproj
dotnet run
Press Esc to exit (the default QuitKey).
Run the comprehensive UI Catalog demo to explore all controls:
dotnet run --project Examples/UICatalog/UICatalog.csproj
Simple Example
using Terminal.Gui;
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 the Examples directory for more.
Build Powerful Terminal Applications
Terminal.Gui enables building sophisticated console applications with modern UIs:
- Rich Forms and Dialogs - Text fields, buttons, checkboxes, radio buttons, and data validation
- Interactive Data Views - Tables, lists, and trees with sorting, filtering, and in-place editing
- Visualizations - Charts, graphs, progress indicators, and color pickers with TrueColor support
- Text Editors - Full-featured text editing with clipboard, undo/redo, and Unicode support
- File Management - File and directory browsers with search and filtering
- Wizards and Multi-Step Processes - Guided workflows with navigation and validation
- System Monitoring Tools - Real-time dashboards with scrollable, resizable views
- Configuration UIs - Settings editors with persistent themes and user preferences
- Cross-Platform CLI Tools - Consistent experience on Windows, macOS, and Linux
- Server Management Interfaces - SSH-compatible UIs for remote administration
See the Views Overview for available controls and What's New in v2 for architectural improvements.
Documentation
Comprehensive documentation is at gui-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
v2 Alpha (Recommended)
dotnet add package Terminal.Gui --version "2.0.0-alpha.*"
v2 Develop (Latest)
dotnet add package Terminal.Gui --version "2.0.0-develop.*"
v1 Legacy
dotnet add package Terminal.Gui --version "1.*"
Or use the Terminal.Gui.Templates.
Contributing
Contributions welcome! See CONTRIBUTING.md.
History
See gui-cs for project history and origins.
Languages
C#
99.4%
PowerShell
0.6%

