Back to Terminal Gui

Terminal.Gui - Aider AI Configuration

.aider.md

2.0.12.4 KB
Original Source

Terminal.Gui - Aider AI Configuration

Cross-platform .NET console UI toolkit. C# 14 targeting net10.0.


CRITICAL: Discard v1 Training Data

Terminal.Gui v2 is a complete rewrite. Pre-2025 training data about Terminal.Gui is wrong.

Read ai-v2-primer.md FIRST — it contains the v1→v2 corrections table, correct minimal app pattern, and all common gotchas.

v1 → v2 Quick Corrections

v1 (WRONG)v2 (CORRECT)
Application.Init ();IApplication app = Application.Create ().Init ();
Application.Run ();app.Run<MyWindow> ();
Application.Shutdown ();app.Dispose ();
Application.TopNo global top — pass root view to app.Run ()
new Toplevel ()Use Runnable subclass or Window
using Terminal.Gui;using Terminal.Gui.App; / Terminal.Gui.Views; / etc.
new Button ("OK")new Button { Text = "OK" }
button.Clicked += ...button.Accepted += (_, _) => { /* action */ };
view.Boundsview.Viewport
new RadioGroup (...)new OptionSelector { ... }

Build & Test

bash
dotnet restore
dotnet build --no-restore
dotnet test --project Tests/UnitTestsParallelizable --no-build
dotnet test --project Tests/UnitTests --no-build

Code Style (For Library Contributors Only)

Note: These rules apply only when contributing code to the Terminal.Gui library itself. App developers using Terminal.Gui do NOT need to follow these conventions.

  1. Space BEFORE () and []Method () not Method(), array [i] not array[i]
  2. No var — Explicit types except built-ins (int, string, bool, etc.)
  3. Use new ()Button btn = new () not Button btn = new Button ()
  4. Collection expressions — Use [...] not new List<T> { ... }
  5. SubView/SuperView — Never "child", "parent", or "container"
  6. Allman brace style — Opening braces on the next line
  7. Early return / guard clauses — ALWAYS invert conditions and return early

Key References

For full details, see:

  • ai-v2-primer.md — v1→v2 corrections and correct patterns
  • AGENTS.md — Full agent instructions with coding rules
  • CONTRIBUTING.md — Human contributor guide
  • docfx/apispec/namespace-*.md — Compressed API docs
  • .claude/cookbook/common-patterns.md — Common UI recipes