Error-String-Expected-Got-Nil 40602ee628 Addresses #4058. Basic support for non-color text styles. (#4071)
* TextStyle enum

* CSI_AppendTextStyleChange

* Add TextStyle to Attribute

* Apply text style in NetOutput.Write()

* Don't append escape code if nothing to change

* Make TextStyle an init property

* Apply TextStyle to OutputBuffer attributes

* Fix flag checking

Misunderstood how Enum.HasFlag worked, fixed now

* Allow bold-faint text

Also adds remarks to TextStyle noting that they may be incompatible depending on terminal settings.

* Remove unnecessary check

Realized it's actually impossible for no escape codes to be added, as this is only the case when prev and next are the same, which is already accounted for.

* Remove redundant check

Attributes are records, and thus already use equality-by-value, meaning attr != redrawAttr will already be false when the TextStyle changes.

* WindowsOutput support for text style

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-05-29 14:08:48 -06:00
2025-03-21 09:17:49 +01:00
2025-05-29 14:08:47 -06:00
2025-03-06 12:48:44 -07:00
2024-06-25 05:53:19 -07:00
2024-08-27 07:10:42 -07:00
2025-03-06 12:48:44 -07:00
Add
2018-01-05 22:11:08 -05:00
2024-11-25 15:58:51 +01:00

Terminal.Gui .NET Core Version Code Coverage Downloads License Bugs

  • The current, stable, release of Terminal.Gui v1 is Version.
  • The current prealpha release of Terminal.Gui v2 can be found on Nuget.
  • Developers starting new TUI projects are encouraged to target v2. The API is significantly changed, and significantly improved. There will be breaking changes in the API before Beta, but the core API is stable.
  • v1 is in maintenance mode and we will only accept PRs for issues impacting existing functionality.

Terminal.Gui: A toolkit for building rich console apps for Windows, the Mac, and Linux/Unix.

Sample app

Quick Start

Paste these commands into your favorite terminal on Windows, Mac, or Linux. This will install the Terminal.Gui.Templates, create a new "Hello World" TUI app, and run it.

(Press CTRL-Q to exit the app)

dotnet new --install Terminal.Gui.templates
dotnet new tui -n myproj
cd myproj
dotnet run

To run the UICatalog demo app that shows all the controls and features of the toolkit, use the following command:

dotnet run --project Examples/UICatalog/UICatalog.csproj

There is also a visual designer (uses Terminal.Gui itself).

Documentation

The above documentation matches the most recent Nuget release from the v2_develop branch. Get the v1 documentation here.

See the Terminal.Gui/README for an overview of how the library is structured.

Showcase & Examples

  • The ./Examples/UICatalog project is a showcase of all the controls and features of the toolkit. There are more examples in the ./Examples folder.

  • Showcase is a place where you can find all kind of projects from simple examples to advanced real world apps that fully utilize capabilities of the toolkit. The team is looking forward to seeing new amazing projects made by the community to be added there!

Sample Usage in C#

The following example shows a basic Terminal.Gui application in C#:
Example (source)

When run the application looks as follows:

Simple Usage app

Sample usage in F#

An F# example is located here.

Installing

Use NuGet to install the Terminal.Gui NuGet package: https://www.nuget.org/packages/Terminal.Gui

Installation in .NET Core Projects

To install Terminal.Gui into a .NET Core project, use the dotnet CLI tool with this command.

dotnet add package Terminal.Gui

Or, you can use the Terminal.Gui.Templates.

Contributing

See CONTRIBUTING.md.

Debates on architecture and design can be found in Issues tagged with design.

History

See gui-cs for how this project came to be.

Languages
C# 99.4%
PowerShell 0.6%