Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 17 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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).
Expand All @@ -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
```
Expand All @@ -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).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public IEnumerable<Suggestion> GenerateSuggestions (AutocompleteContext context)
return [];
}

if (term.Equals (_state?.Directory?.Name))
if (term.Equals (_state?.Directory.Name))
{
// Clear suggestions
return [];
Expand Down
10 changes: 10 additions & 0 deletions Terminal.Gui/Views/Dialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ namespace Terminal.Gui.Views;
/// becomes the default (<see cref="Button.IsDefault"/>). Button alignment is controlled by
/// <see cref="Dialog{TResult}.ButtonAlignment"/> and <see cref="Dialog{TResult}.ButtonAlignmentModes"/>.
/// </para>
/// <para>
/// The dialog is positioned at <see cref="Pos.Center"/> with <see cref="Dim.Auto"/> sizing,
/// limited to 100% of <see cref="IApplication.TopRunnableView"/> (or screen dimensions).
/// </para>
/// <para>
/// <b>NOTE </b> - Setting <see cref="View.ViewportSettings"/> to
/// <see cref="ViewportSettingsFlags.HasHorizontalScrollBar"/> or
/// <see cref="ViewportSettingsFlags.HasVerticalScrollBar"/>
/// is not supported and may cause layout issues.
/// </para>
/// </remarks>
/// <example>
/// <code>
Expand Down
14 changes: 10 additions & 4 deletions Terminal.Gui/Views/DialogTResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ namespace Terminal.Gui.Views;
/// Subclasses should set <see cref="IRunnable{TResult}.Result"/> before calling <see cref="Runnable.RequestStop"/>
/// to return a value. If Result is not set (remains <c>null</c>), the dialog is considered canceled.
/// </para>
/// <para>
/// The dialog is positioned at <see cref="Pos.Center"/> with <see cref="Dim.Auto"/> sizing,
/// limited to 100% of <see cref="IApplication.TopRunnableView"/> (or screen dimensions).
/// </para>
/// <para>
/// <b>NOTE </b> - Setting <see cref="View.ViewportSettings"/> to
/// <see cref="ViewportSettingsFlags.HasHorizontalScrollBar"/> or
/// <see cref="ViewportSettingsFlags.HasVerticalScrollBar"/>
/// is not supported and may cause layout issues.
/// </para>
/// </remarks>
/// <example>
/// <code>
Expand Down Expand Up @@ -69,10 +79,6 @@ public class Dialog<TResult> : Runnable<TResult>, IDesignable
/// <summary>
/// Initializes a new instance of the <see cref="Dialog{TResult}"/> class with no buttons.
/// </summary>
/// <remarks>
/// The dialog is positioned at <see cref="Pos.Center"/> with <see cref="Dim.Auto"/> sizing,
/// limited to 100% of <see cref="IApplication.TopRunnableView"/> (or screen dimensions).
/// </remarks>
public Dialog ()
{
X = Pos.Center ();
Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Views/FileDialogs/FileDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
/// <summary>
/// Gets the index of the cancel button for the dialog. This is useful for checking if the user canceled the dialog by
/// comparing
/// the <see cref="Dialog.Result"/> to the index of this button in the <see cref="Dialog.Buttons"/> array.

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Build All Configurations

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Build All Configurations

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Build All Configurations

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (macos-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Integration Tests (windows-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Integration Tests (windows-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (macos-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (ubuntu-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Integration Tests (ubuntu-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Integration Tests (ubuntu-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (windows-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Integration Tests (macos-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Integration Tests (macos-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Non-Parallel Unit Tests (windows-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

XML comment has cref attribute 'Buttons' that could not be resolved

Check warning on line 36 in Terminal.Gui/Views/FileDialogs/FileDialog.cs

View workflow job for this annotation

GitHub Actions / Parallel Unit Tests (ubuntu-latest)

XML comment has cref attribute 'Buttons' that could not be resolved
/// </summary>
public int CancelButtonIndex => Buttons.IndexOf (_btnCancel);

Expand Down Expand Up @@ -450,7 +450,7 @@
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 = [];
Expand Down
11 changes: 11 additions & 0 deletions Terminal.Gui/Views/FileDialogs/FileDialogState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@ public FileDialogState (IDirectoryInfo dir, FileDialog parent)
{
Parent = parent;
Directory = dir;
Path = parent.Path;
Children = GetChildren (Directory).ToArray ();
}

/// <summary>
/// Constructor for subclasses that manage their own Children population (e.g. <see cref="FileDialog.SearchState"/>).
/// </summary>
protected FileDialogState (IDirectoryInfo dir, FileDialog parent, bool skipInitialEnumeration)
{
Parent = parent;
Directory = dir;
Path = parent.Path;
Children = skipInitialEnumeration ? [] : GetChildren (Directory).ToArray ();
}

protected FileDialog Parent { get; }
Expand Down
4 changes: 2 additions & 2 deletions docfx/docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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#
Expand Down
5 changes: 1 addition & 4 deletions docfx/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
84 changes: 36 additions & 48 deletions docfx/includes/home-content.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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.
17 changes: 4 additions & 13 deletions docfx/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading