* Refactor newinv2.md deep dive doc Terminal.Gui v2 introduces a transformative redesign, simplifying the library's architecture and improving maintainability. Key changes include: - Added TrueColor support with 24-bit RGB handling. - Introduced `Adornment` framework for borders, padding, and margins. - Enhanced Unicode and wide character support for internationalization. - Added `LineCanvas` for drawing lines and shapes with box-drawing characters. - Simplified API by consolidating redundant methods and aligning with modern .NET standards. - Introduced `ConfigurationManager` for user-customizable themes and text styles. - Improved scrolling with `Viewport` and integrated `ScrollBar`. - Added new layout features like `Dim.Auto`, `Pos.AnchorEnd`, and `Pos.Align`. - Overhauled keyboard and mouse APIs for better input handling. - Introduced new views (e.g., `DatePicker`, `ColorPicker`, `GraphView`) and enhanced existing ones. - Added Sixel image support for rendering graphics in compatible terminals. - Ensured AOT compatibility for improved deployment and performance. This update lays the foundation for building modern, user-friendly terminal applications. * Fixes #4368 - Clarify and Fix CWPPropertyHelper Property Change Workflow Refactor ChangeProperty method for clarity and flexibility Updated the `<param>` documentation for `currentValue` to clarify its behavior. Changed the `currentValue` parameter to be passed by reference (`ref`) to allow direct updates to the caller's variable. Made the `onChanging` delegate nullable and added a null check to prevent potential exceptions. Moved the `cancelled` variable inside the null-check block for `onChanging` to simplify logic. Explicitly updated `currentValue` to `finalValue` after the `doWork` action to ensure consistency. These changes improve the method's robustness, flexibility, and clarity. * Refactor ChangeProperty calls to use ref parameters Updated `CWPPropertyHelper.ChangeProperty` calls in `View.Drawing.Scheme.cs` and `View.Layout.cs` to pass fields as `ref` parameters. This ensures direct modification of fields, improving property update handling. Affected properties: - `_schemeName` and `_scheme` in `View.Drawing.Scheme.cs` - `_height` and `_width` in `View.Layout.cs` Property change notification logic remains unchanged. This refactor enhances maintainability and correctness without introducing new functionality.
Terminal.Gui Project
Terminal.Gui is a cross-platform UI toolkit for creating console-based graphical user interfaces in .NET. This repository contains all files required to build the Terminal.Gui library and NuGet package, enabling developers to create rich terminal applications with ease.
Project Overview
Terminal.Gui provides a comprehensive framework for building interactive console applications with support for keyboard and mouse input, customizable views, and a robust event system. It is designed to work across Windows, macOS, and Linux, leveraging platform-specific console capabilities where available.
Project Folder Structure
This directory contains the core Terminal.Gui library source code. For a detailed repository structure, see CONTRIBUTING.md - Repository Structure.
Getting Started
For instructions on how to start using Terminal.Gui, refer to the Getting Started Guide in our documentation.
Documentation
Comprehensive documentation is available at gui-cs.github.io/Terminal.Gui.
For information on generating and updating the API documentation locally, refer to the DocFX README.
Versioning
Version information for Terminal.Gui is managed by gitversion. To install gitversion:
dotnet tool install --global GitVersion.Tool
dotnet-gitversion
The project version (used in the NuGet package and Terminal.Gui.dll) is determined from the latest git tag. The format of version numbers is major.minor.patch.build.height and follows Semantic Versioning rules.
To define a new version, tag a commit using git tag:
git tag v2.1.0-beta.1 -a -m "Release v2.1.0 Beta 1"
dotnet-gitversion /updateprojectfiles
dotnet build -c Release
DO NOT COMMIT AFTER USING /updateprojectfiles! Doing so will update the .csproj files in your branch with version info, which we do not want.
Publishing a Release of Terminal.Gui
To release a new version, follow these steps based on Semantic Versioning rules:
- MAJOR version for incompatible API changes.
- MINOR version for backwards-compatible functionality additions.
- PATCH version for backwards-compatible bug fixes.
Steps for Release:
-
Verify the
v2_developbranch is ready for release:- Ensure all changes are committed and pushed to the
v2_developbranch. - Ensure your local
v2_developbranch is up-to-date withupstream/v2_develop.
- Ensure all changes are committed and pushed to the
-
Create a pull request for the release in the
v2_developbranch:- Title the PR as "Release vX.Y.Z".
git checkout v2_develop git pull upstream v2_develop git checkout -b vX_Y_Z git add . git commit -m "Release vX.Y.Z" git push- Go to the link printed by
git pushand fill out the Pull Request.
-
On github.com, verify the build action worked on your fork, then merge the PR.
-
Pull the merged
v2_developfromupstream:git checkout v2_develop git pull upstream v2_develop -
Merge
v2_developintov2_release:git checkout v2_release git pull upstream v2_release git merge v2_develop- Fix any merge errors.
-
Create a new annotated tag for the release on
v2_release:git tag vX.Y.Z -a -m "Release vX.Y.Z" -
Push the new tag to
v2_releaseonupstream:git push --atomic upstream v2_release vX.Y.Z -
Monitor Github Actions to ensure the NuGet publishing worked:
- Check GitHub Actions.
-
Check NuGet to see the new package version (wait a few minutes):
- Visit NuGet Package.
-
Add a new Release in Github:
- Go to GitHub Releases and generate release notes with the list of PRs since the last release.
-
Update the
v2_developbranch with the new version:git checkout v2_develop git pull upstream v2_develop git merge v2_release git push upstream v2_develop
NuGet
The official NuGet package for Terminal.Gui is available at https://www.nuget.org/packages/Terminal.Gui. When a new version tag is defined and merged into v2_release, a NuGet package is automatically generated by a GitHub Action. Pre-release versions (e.g., 2.0.0-beta.5) are tagged as pre-release on NuGet.
Contributing
We welcome contributions from the community. For complete contribution guidelines, including:
- Build and test instructions
- Coding conventions and style rules
- Testing requirements and patterns
- Pull request guidelines
- CI/CD workflows
Please refer to CONTRIBUTING.md in the repository root.