Skip to content

Migrate console GUI from Terminal.Gui 1.19.0 to 2.x #276

Open

Description

@jas88

Terminal.Gui 2.x is a ground-up API redesign; the dependabot bump (#252, closed) fails with 231 unique compile errors. A scoped dependabot ignore for Terminal.Gui major bumps keeps v1 patches flowing meanwhile.

Current state

  • Pinned at 1.19.0 — the latest v1 release (June 2025); v1 cadence has effectively stopped upstream
  • No known security advisories against Terminal.Gui at any version (GitHub Advisory DB empty), so the risk of staying is bit-rot, not CVEs

Scope

29 files / ~6k LOC / 352 Terminal.Gui symbol references:

  • Tools/rdmp/CommandLine/Gui + Gui/Windows + RunnerWindows (26 files)
  • Tools/rdmp/CommandLine/ColorSettings.cs
  • RdmpDicom/Rdmp.Dicom SemEHRConsoleUI + RdmpDicomUserInterface (3 files — migrates in the same pass now the plugin is vendored in-repo)

Work breakdown

Mechanical (~60-70%): sub-namespace usings (v2 splits into Terminal.Gui.Views/App/Drawing/Input/ViewBase), ustring/NStack → string, Rect → Rectangle, constructor-with-Rect → object initializers, Attribute.Make → new Attribute, Pos/Dim renames, Clicked → Accepting with (sender, args) signatures (~43 handlers).

Structural (~30-40%):

  • Application lifecycle: static Application.Init/Run/Shutdown → instance model with explicit IDisposable (v1 disposed views on Shutdown; v2 does not — leak/lifecycle risk beyond compile fixes)
  • Key/Mouse event model redesign (KeyEventEventArgs gone) — RunEngineWindow plumbing
  • Application.MainLoop.Invoke → app.Invoke at 17 threading sites (pipeline progress updates)
  • Custom IListDataSource in ConsoleGuiBigListBox — interface changed
  • ConsoleGuiSqlEditor custom autocomplete (TextView/TextFieldAutocomplete APIs redesigned)
  • TableView/TreeView (Trees namespace) API changes; ColorScheme/TrueColor theming; ScrollView removed (built-in scrolling); Bounds → Viewport

Approach

Dedicated branch/milestone, not a dependency bump. Adopt v2 patterns properly (instance app, Dim.Auto, built-in scrolling) rather than minimal-diff patching. Console GUI has thin automated test coverage — plan manual TUI regression testing (focus, disposal, key handling, pipeline-run windows). Reference: upstream migration guide docfx/docs/migratingfromv1.md in gui-cs/Terminal.Gui.

Estimate: 3-5 focused dev-days + regression testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions