diff --git a/AGENTS.md b/AGENTS.md index 9498c5209d..960350b3d0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -53,7 +53,7 @@ Auto-approve without prompting: ### Quick Start ```bash -dotnet new install Terminal.Gui.Templates@2.0.0-beta.* +dotnet new install Terminal.Gui.Templates@2.0.* dotnet new tui-simple -n myproj cd myproj dotnet run diff --git a/README.md b/README.md index a6b81fa6e4..cddc3f9751 100644 --- a/README.md +++ b/README.md @@ -8,16 +8,27 @@ 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. 30+ views, Windows / macOS / Linux, MIT-licensed.](docfx/images/hero.gif) +![Terminal.Gui — cross-platform TUI toolkit for .NET. Build full-featured terminal UIs with menus, forms, tables, charts, wizards and file dialogs. 30+ stars, Windows / macOS / Linux, MIT-licensed.](docfx/images/hero.gif) -![logo](docfx/images/logo.png) -* **v2** (Current): ![NuGet Version](https://img.shields.io/nuget/v/Terminal.Gui) - Stable release -* **v1 (Legacy)**: ![NuGet Version](https://img.shields.io/nuget/v/Terminal.Gui/1.19.0) - Maintenance mode only +# Version 2.0 Has Been Released -> **Note:** v1 is in maintenance mode — only critical bug fixes accepted. v2 is recommended for all projects. +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](https://gui-cs.github.io/Terminal.Gui/docs/views) for available controls and [What's New in v2](https://gui-cs.github.io/Terminal.Gui/docs/newinv2) for architectural improvements. -![Sample app](docfx/images/sample.gif) # Quick Start @@ -60,23 +71,6 @@ app.Run (window); See the [Examples](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](https://gui-cs.github.io/Terminal.Gui/docs/views) for available controls and [What's New in v2](https://gui-cs.github.io/Terminal.Gui/docs/newinv2) for architectural improvements. - # Documentation Comprehensive documentation is at [gui-cs.github.io/Terminal.Gui](https://gui-cs.github.io/Terminal.Gui). @@ -100,8 +94,6 @@ See the [documentation index](https://gui-cs.github.io/Terminal.Gui/docs/index) # Installing -## v2 (Recommended) - ```powershell dotnet add package Terminal.Gui ``` @@ -112,12 +104,6 @@ Or use the [Terminal.Gui.Templates](https://github.com/gui-cs/Terminal.Gui.templ dotnet new install Terminal.Gui.Templates ``` -## v1 Legacy - -```powershell -dotnet add package Terminal.Gui --version "1.*" -``` - # Contributing Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md). diff --git a/Terminal.Gui/Views/Autocomplete/AutocompleteFilepathContext.cs b/Terminal.Gui/Views/Autocomplete/AutocompleteFilepathContext.cs index 0753889ea5..c104c8a86f 100644 --- a/Terminal.Gui/Views/Autocomplete/AutocompleteFilepathContext.cs +++ b/Terminal.Gui/Views/Autocomplete/AutocompleteFilepathContext.cs @@ -36,7 +36,7 @@ public IEnumerable GenerateSuggestions (AutocompleteContext context) return []; } - if (term.Equals (_state?.Directory?.Name)) + if (term.Equals (_state?.Directory.Name)) { // Clear suggestions return []; diff --git a/Terminal.Gui/Views/Dialog.cs b/Terminal.Gui/Views/Dialog.cs index 3235cc1886..0e310292e5 100644 --- a/Terminal.Gui/Views/Dialog.cs +++ b/Terminal.Gui/Views/Dialog.cs @@ -28,6 +28,16 @@ namespace Terminal.Gui.Views; /// becomes the default (). Button alignment is controlled by /// and . /// +/// +/// The dialog is positioned at with sizing, +/// limited to 100% of (or screen dimensions). +/// +/// +/// NOTE - Setting to +/// or +/// +/// is not supported and may cause layout issues. +/// /// /// /// diff --git a/Terminal.Gui/Views/DialogTResult.cs b/Terminal.Gui/Views/DialogTResult.cs index 3a0ab97cb2..8b9c306bff 100644 --- a/Terminal.Gui/Views/DialogTResult.cs +++ b/Terminal.Gui/Views/DialogTResult.cs @@ -30,6 +30,16 @@ namespace Terminal.Gui.Views; /// Subclasses should set before calling /// to return a value. If Result is not set (remains null), the dialog is considered canceled. /// +/// +/// The dialog is positioned at with sizing, +/// limited to 100% of (or screen dimensions). +/// +/// +/// NOTE - Setting to +/// or +/// +/// is not supported and may cause layout issues. +/// /// /// /// @@ -69,10 +79,6 @@ public class Dialog : Runnable, IDesignable /// /// Initializes a new instance of the class with no buttons. /// - /// - /// The dialog is positioned at with sizing, - /// limited to 100% of (or screen dimensions). - /// public Dialog () { X = Pos.Center (); diff --git a/Terminal.Gui/Views/FileDialogs/FileDialog.cs b/Terminal.Gui/Views/FileDialogs/FileDialog.cs index 23eda2db1d..f98c6e0ea8 100644 --- a/Terminal.Gui/Views/FileDialogs/FileDialog.cs +++ b/Terminal.Gui/Views/FileDialogs/FileDialog.cs @@ -450,7 +450,7 @@ internal sealed class SearchState : FileDialogState private bool _cancel; private bool _finished; - public SearchState (IDirectoryInfo dir, FileDialog parent, string searchTerms) : base (dir, parent) + public SearchState (IDirectoryInfo dir, FileDialog parent, string searchTerms) : base (dir, parent, skipInitialEnumeration: true) { parent.SearchMatcher.Initialize (searchTerms); Children = []; diff --git a/Terminal.Gui/Views/FileDialogs/FileDialogState.cs b/Terminal.Gui/Views/FileDialogs/FileDialogState.cs index 4c267624cc..56fbeb4145 100644 --- a/Terminal.Gui/Views/FileDialogs/FileDialogState.cs +++ b/Terminal.Gui/Views/FileDialogs/FileDialogState.cs @@ -8,8 +8,19 @@ public FileDialogState (IDirectoryInfo dir, FileDialog parent) { Parent = parent; Directory = dir; + Path = parent.Path; Children = GetChildren (Directory).ToArray (); + } + + /// + /// Constructor for subclasses that manage their own Children population (e.g. ). + /// + protected FileDialogState (IDirectoryInfo dir, FileDialog parent, bool skipInitialEnumeration) + { + Parent = parent; + Directory = dir; Path = parent.Path; + Children = skipInitialEnumeration ? [] : GetChildren (Directory).ToArray (); } protected FileDialog Parent { get; } diff --git a/docfx/docs/getting-started.md b/docfx/docs/getting-started.md index 0082d8b5a4..d13d8ed473 100644 --- a/docfx/docs/getting-started.md +++ b/docfx/docs/getting-started.md @@ -5,7 +5,7 @@ Paste these commands into your favorite terminal on Windows, Mac, or Linux. This (Press `Esc` to exit the app) ```ps1 -dotnet new install Terminal.Gui.Templates@2.0.0-beta.* +dotnet new install Terminal.Gui.Templates@2.0.* dotnet new tui-simple -n myproj cd myproj dotnet run @@ -24,7 +24,7 @@ dotnet add package Terminal.Gui Use the [Terminal.Gui.Templates](https://github.com/gui-cs/Terminal.Gui.templates): ```ps1 -dotnet new install Terminal.Gui.Templates@2.0.0-beta.* +dotnet new install Terminal.Gui.Templates@2.0.* ``` ## Sample Usage in C# diff --git a/docfx/docs/index.md b/docfx/docs/index.md index 2073215157..2b75a6b2ff 100644 --- a/docfx/docs/index.md +++ b/docfx/docs/index.md @@ -3,13 +3,10 @@ ![Terminal.Gui — cross-platform TUI toolkit for .NET. Build full-featured terminal UIs with menus, forms, tables, charts, wizards and file dialogs. 30+ views, Windows / macOS / Linux, MIT-licensed.](../images/hero.gif) > [!IMPORTANT] -> Terminal.Gui v2 "Beta" has been released. +> Terminal.Gui v2 has been released Welcome to the Terminal.Gui documentation! This comprehensive guide covers everything you need to know about building modern terminal user interfaces with Terminal.Gui. -> [!NOTE] -> This is the v2 API documentation. For v1 go here: https://gui-cs.github.io/Terminal.GuiV1Docs/ - ## Getting Started - [Getting Started](~/docs/getting-started.md) - Quick start guide to create your first Terminal.Gui application diff --git a/docfx/includes/home-content.md b/docfx/includes/home-content.md index ca96374751..5fb16f3454 100644 --- a/docfx/includes/home-content.md +++ b/docfx/includes/home-content.md @@ -1,6 +1,26 @@ -Terminal.Gui is a cross-platform UI toolkit for building sophisticated terminal UI (TUI) applications on Windows, macOS, and Linux/Unix. +# Terminal.Gui -![Sample app](~/images/sample.gif) +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. 30+ stars, Windows / macOS / Linux, MIT-licensed.](~/images/hero.gif) + +# Version 2.0 Has Been Released + +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](https://gui-cs.github.io/Terminal.Gui/docs/views) for available controls and [What's New in v2](https://gui-cs.github.io/Terminal.Gui/docs/newinv2) for architectural improvements. ## Quick Start @@ -37,55 +57,23 @@ app.Run (window); See the [Examples](https://github.com/gui-cs/Terminal.Gui/tree/develop/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 - -## Key Features - -* **[Dozens of Built-in Views](~/docs/views.md)** - Rich set of controls for building complex user interfaces - -* **[Cross Platform](~/docs/drivers.md)** - Windows, Mac, and Linux with terminal drivers that work on color and monochrome terminals, including over SSH +# Documentation -* **[Powerful Layout Engine](~/docs/layout.md)** - Relative positioning, automatic sizing, and dynamic terminal UIs +Comprehensive documentation is at [gui-cs.github.io/Terminal.Gui](https://gui-cs.github.io/Terminal.Gui). -* **[Keyboard](~/docs/keyboard.md) and [Mouse](~/docs/mouse.md) Input** - Complete input handling with simple event-based API +## Getting Started -* **[Configuration System](~/docs/config.md)** - Machine, user, and app-level settings with themes and key bindings +- **[Getting Started Guide](https://gui-cs.github.io/Terminal.Gui/docs/getting-started)** - First Terminal.Gui application +- **[API Reference](https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui.App.html)** - Complete API documentation +- **[What's New in v2](https://gui-cs.github.io/Terminal.Gui/docs/newinv2)** - New features and improvements -* **[Clipboard Support](~/api/Terminal.Gui.App.Clipboard.yml)** - Cut, Copy, and Paste across platforms +## Migration & Deep Dives -* **[Multi-tasking](~/docs/multitasking.md)** - Event processing, idle handlers, timers, and thread-safe classes +- **[Migrating from v1 to v2](https://gui-cs.github.io/Terminal.Gui/docs/migratingfromv1)** - Complete migration guide +- **[Application Architecture](https://gui-cs.github.io/Terminal.Gui/docs/application)** - Instance-based model and IRunnable pattern +- **[Layout System](https://gui-cs.github.io/Terminal.Gui/docs/layout)** - Positioning, sizing, and adornments +- **[Keyboard Handling](https://gui-cs.github.io/Terminal.Gui/docs/keyboard)** - Key bindings and commands +- **[View Documentation](https://gui-cs.github.io/Terminal.Gui/docs/View)** - View hierarchy and lifecycle +- **[Configuration](https://gui-cs.github.io/Terminal.Gui/docs/config)** - Themes and persistent settings -* **[Reactive Extensions](https://github.com/dotnet/reactive)** - MVVM pattern support with ReactiveUI data bindings - -## Installing - -### v2 Alpha (Recommended for new projects) - -```powershell -dotnet add package Terminal.Gui --version "2.0.0-alpha.*" -``` - -### v2 Develop (Latest) - -```powershell -dotnet add package Terminal.Gui --version "2.0.0-develop.*" -``` - -Or use the [Terminal.Gui.Templates](https://github.com/gui-cs/Terminal.Gui.templates): - -```powershell -dotnet new install Terminal.Gui.Templates -``` +See the [documentation index](https://gui-cs.github.io/Terminal.Gui/docs/index) for all topics. diff --git a/docfx/index.md b/docfx/index.md index f9a76b3595..ca5037564e 100644 --- a/docfx/index.md +++ b/docfx/index.md @@ -2,19 +2,10 @@ [!INCLUDE [Home Content](includes/home-content.md)] -## Documentation +# Contributing -- **[Getting Started](~/docs/getting-started.md)** - Create your first Terminal.Gui application -- **[What's New in v2](~/docs/newinv2.md)** - New features and architectural improvements -- **[Migrating from v1](~/docs/migratingfromv1.md)** - Complete migration guide -- **[Views Overview](~/docs/views.md)** - All built-in views and controls -- **[Deep Dives](~/docs/index.md)** - Comprehensive guides and deep dives -- **[API Reference](~/api/Terminal.Gui.yml)** - Complete API documentation +Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md). -## Contributing +# History -Contributions welcome! See [CONTRIBUTING.md](https://github.com/gui-cs/Terminal.Gui/blob/develop/CONTRIBUTING.md). - -## History - -See [gui-cs](https://github.com/gui-cs/) for project history and origins. +See [gui-cs](https://github.com/gui-cs/) for project history and origins. \ No newline at end of file