This file provides instructions for GitHub Copilot when working with the Terminal.Gui project.
Terminal.Gui is a cross-platform UI toolkit for creating console-based graphical user interfaces in .NET. It provides a comprehensive framework for building interactive console applications with support for keyboard and mouse input, customizable views, and a robust event system. The toolkit works across Windows, macOS, and Linux, leveraging platform-specific console capabilities where available.
Key characteristics:
/Terminal.Gui/ - Core library source code
App/ - Core application logic, Application.cs (static class managing RunState and MainLoop)Configuration/ - ConfigurationManager for application settingsDrivers/ - Console driver implementations (IConsoleDriver.cs, NetDriver, UnixDriver, WindowsDriver)Drawing/ - Rendering graphical elements in the consoleInput/ - Keyboard and mouse input handlingView/ - Core View class hierarchyViews/ - Specific sub-classes of View (Toplevel, Window, Dialog, etc.)/Examples/ - Sample applications and demos/Examples/UICatalog/ - Comprehensive demo app for manual testing/Tests/ - Unit and integration tests/docfx/ - Documentation source files (Deep Dive Articles and API docs)/Scripts/ - Build and utility scriptsTerminal.Gui uses GitFlow:
v2_develop - Default branch for v2 development (active development)v2_release - Stable release branches matching NuGet packages./Terminal.sln.DotSettings and ./.editorconfigvar only for the most basic dotnet types - prefer explicit types for clarityAll public APIs must have XML documentation:
<summary> tags<see cref=""/> liberally for cross-references<remarks> for context and detailed explanationsdocfx/articles/*.md files<example> in cases where a sample is needed (not for very obvious things)On[EventName]), following dotnet guidelines.Ctrl-C for copy)Ctrl-Q quits modals)/Tests/./Tests/UnitTests project incorrectly require Application.Init and use [AutoInitShutdown]. Anytime new tests are added or updated, strive to remove these dependencies and make the tests parallelizable. This means not taking any dependency on static objects like Application and ConfigurationManager./docfx/docs/drafts/ and remove before merging.dotnet build
dotnet test
./docfx/docs contains a set of architectural and key-concept deep-dives.
./docfx/docs/ folder when appropriateWhen creating PRs, include instructions at the end of each PR description for how to pull the branch down locally. Use the following template, adapted for the typical remote setup where origin points to the user's fork and upstream points to gui-cs/Terminal.Gui:
## How to Pull This PR Branch Locally
If you want to test or modify this PR locally, use one of these approaches based on your remote setup:
### Method 1: Fetch from upstream (if branch exists there)
bash
git fetch upstream
git checkout
git add . git commit -m "Your commit message"
git push origin
### Method 2: Fetch by PR number
bash
git fetch upstream pull//head:
git checkout
git add . git commit -m "Your commit message"
git push origin
The PR will automatically update when you push to the branch in your fork.
Note: Adjust the remote names if your setup differs (e.g., if origin points to gui-cs/Terminal.Gui and you have a separate remote for your fork).