mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
707dbda71bff4c731b4bd93ccd91fe60c463819e
Dialog and MessageBox key binding do not handle Enter correctly (#3151)
* Moved Command.Accept/Enter key binding from Toplevel to Dialog and added unit tests * Dialog binds Esc to Command.QuitTopLevel * Better Dialog key binding tests * Better MessageBox key binding tests * List of changes: 1. Removed explicit type casting for `Application.QuitKey` in `KeyBindings.Add` method calls. This indicates that `Application.QuitKey` is already of type `KeyCode`. 2. Removed explicit type casting for `Application.AlternateForwardKey` in `KeyBindings.Add` method calls. This suggests that `Application.AlternateForwardKey` is already of type `KeyCode`. 3. Removed explicit type casting for `Application.AlternateBackwardKey` in `KeyBindings.Add` method calls. This implies that `Application.AlternateBackwardKey` is already of type `KeyCode`. References to the code changes: 1. `KeyBindings.Add((KeyCode)Application.QuitKey, QuitApplication);` changed to `KeyBindings.Add(Application.QuitKey, QuitApplication);` 2. `KeyBindings.Add((KeyCode)Application.AlternateForwardKey, MoveForward);` changed to `KeyBindings.Add(Application.AlternateForwardKey, MoveForward);` 3. `KeyBindings.Add((KeyCode)Application.AlternateBackwardKey, MoveBackward);` changed to `KeyBindings.Add(Application.AlternateBackwardKey, MoveBackward);` * The `Command.Accept` command now directly calls the `OnClicked` method and returns `true`, effectively incorporating the behavior of the now-removed `AcceptKey` method. * Moved Command.Accept/Enter key binding from Toplevel to Window and added unit tests
Forces the height of the TextField to 1 which is just the valid height instead of driver rows value. (#400)
The current, stable, release of Terminal.Gui is v1.x. It is stable, rich, and broadly used. The team is now focused on designing and building a significant upgrade we're referring to as v2. Therefore:
v1is now in maintenance mode, meaning we will accept PRs for v1.x (thedevelopbranch) only for issues impacting existing functionality.- All new development happens on the
v2_developbranch. See the V2 discussion here. - Developers are encouraged to continue building on v1.x until we announce
v2is stable.
Terminal.Gui: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
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
Documentation
Showcase & Examples
- UI Catalog - The UI Catalog project provides an easy to use and extend sample illustrating the capabilities of Terminal.Gui. Run
dotnet run --project UICatalogto run the UI Catalog. - C# Example - Run
dotnet runin theExampledirectory to run the C# Example. - F# Example - An example showing how to build a Terminal.Gui app using F#.
- Reactive Example - A sample app that shows how to use
System.ReactiveandReactiveUIwithTerminal.Gui. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUIWhenAnyValuesyntax and Pharmacist — a tool that converts all events in a NuGet package into observable wrappers. - PowerShell's
Out-ConsoleGridView-OCGVsends the output from a command to an interactive table. - F7History - Graphical Command History for PowerShell (built on PowerShell's
Out-ConsoleGridView). - PoshRedisViewer - A compact Redis viewer module for PowerShell written in F#.
- PoshDotnetDumpAnalyzeViewer - dotnet-dump UI module for PowerShell.
- TerminalGuiDesigner - Cross platform view designer for building Terminal.Gui applications.
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%

