The tenets in each section are listed in precedence order. When two tenets conflict, the one higher in this document wins.
This document is the single authoritative source for Terminal.Gui's product mission, non-goals, engineering philosophy, and design tenets. All other documents (CONTRIBUTING.md, CLAUDE.md, .claude/rules/, and the deep-dive docs in docfx/docs/) elaborate on these tenets; they do not supersede them.
- I. Mission
- II. Non-Goals
- III. Tenets
- IV. Engineering Philosophy
- V. Code Style Tenets
- Relationship to Sub-Projects
Terminal.Gui is a cross-platform UI toolkit for building sophisticated terminal UI (TUI) applications on .NET. It is the standard by which TUI applications on .NET are measured.
These were considered and rejected — do not accidentally pursue them:
- Terminal.Gui is not a web framework. We do not pursue HTML/CSS layout models.
- Terminal.Gui is not a replacement for ncurses. We target .NET developers, not C developers.
- Terminal.Gui is not a pixel renderer. Width is measured in terminal cells, not pixels.
- Terminal.Gui is not opinionated about application architecture. We provide building blocks; we do not mandate MVVM, MVC, or any other application pattern.
- Terminal.Gui does not own the terminal. We share it with the host shell and must be good citizens (clean up on exit, respect terminal state).
Users choose the platform, the terminal, and the key bindings. Our defaults are consistent and sensible, but everything configurable must be configurable. We never hardcode behavior that the user or developer cannot override. See the Keyboard deep dive and Mouse deep dive.
Terminal users expect full functionality without a mouse. Anything that can be done with the mouse must also be doable with the keyboard. We avoid mouse-only features. See the Mouse deep dive.
Once a Terminal.Gui app starts, the user is no longer using the command line. Users expect keyboard idioms consistent with GUI apps (VS Code, Vim, Emacs, etc.), not shell idioms. See the Keyboard deep dive.
Users choose their platform. Terminal.Gui apps must respond to keyboard and mouse input in a way consistent with platform conventions. The source of truth for default key bindings is Wikipedia's keyboard shortcuts table. See the Keyboard deep dive.
If a View with a HotKey is visible and the HotKey is shown, pressing that HotKey must invoke the defined behavior. We strive to ensure that modal contexts do not leave HotKeys appearing active when they are not. See the Keyboard deep dive.
Layout, focus, input, and drawing are cleanly decoupled. We resist the urge to merge them for short-term convenience. See the v2 Architecture overview and Layout deep dive.
Views must be testable in isolation without global state. Application.Init is required only for integration tests. We maintain ≥80% test coverage and we never decrease it. See Testing patterns.
We measure rendering and event-handling overhead. We never accept regressions in the hot path without a documented justification. See the Drawing deep dive.
API documentation is the contract. When docs and code conflict, the code is wrong. See api-documentation rules and Code Style Tenet 5 in CONTRIBUTING.md.
Text measurement and rendering always operate on grapheme clusters, not char or Rune values. Always use string.GetColumns() for width; always iterate with GraphemeHelper.GetGraphemes() for rendering. See Unicode/Grapheme rules.
Developers — AI agents and humans — working on Terminal.Gui strive to raise the bar as Principal Engineers. Principal Engineers are measured by how they live the Amazon PE Community Tenets:
- Exemplary practitioner — set the standard through your own work.
- Technically fearless — tackle the hardest, most ambiguous problems.
- Lead with empathy — foster inclusion; be mindful of your impact.
- Balanced and pragmatic — neither dogmatic nor reckless.
- Illuminate and clarify — bring clarity to complexity; drive crisp decisions.
- Flexible in approach — adapt style and methods to the problem at hand.
- Respect what came before — appreciate existing systems; learn from the past.
- Learn, educate, and advocate — pursue continuous learning and teach others.
- Have resounding impact — results are the minimum; lasting impact is the bar.
(Source of truth: CONTRIBUTING.md)
- Six-Year-Old Reading Level — Readability over terseness.
- Consistency, Consistency, Consistency — Follow existing patterns ruthlessly.
- Don't Be Weird — Follow Microsoft/.NET conventions.
- Set and Forget — Rely on automated tooling; don't fight the formatter.
- Documentation Is the Spec — API docs define the contract; implementation must match.
Sub-projects (e.g., Terminal.Gui.Text) may extend this constitution. When a sub-project tenet conflicts with a tenet in this document, this document wins unless the sub-project explicitly documents the exception and the reason.