Skip to content

Update to TG 2.5.0-beta.1 - #287

Merged
tig merged 14 commits into
developfrom
tg25-port
Sep 4, 2026
Merged

Update to TG 2.5.0-beta.1#287
tig merged 14 commits into
developfrom
tg25-port

Conversation

@tig

@tig tig commented Aug 23, 2026

Copy link
Copy Markdown
Member

⚠️ DO NOT MERGE with the pre-release pin in place

This PR pins Terminal.Gui to public nuget.org 2.5.0-develop.55 (<TerminalGuiVersion> in Directory.Build.props). The Aug 22 vendored 2.5.0-tig-remove-cm-followup.2 feed is gone (local_packages/ and nuget.config deleted). Before merging:

  1. Wait for stable Terminal.Gui 2.5.x on nuget.org.
  2. Set <TerminalGuiVersion> in Directory.Build.props to that public 2.5.x (the only central pin — every csproj uses $(TerminalGuiVersion)).
  3. Re-run dotnet restore + build + all three CI test suites and confirm Terminal.Gui restores from nuget.org with no 2.5.0-develop.* pin left.
  4. Drop the TEMP comment above <TerminalGuiVersion>.

What this is

Part of the Terminal.Gui v2.5.0 ecosystem-validation gate (tui-cs/Terminal.Gui#5630). tui-cs/Terminal.Gui#5416 is on develop. This PR ports Editor/ted to public 2.5.0-develop.55 (v2.5.0 ecosystem gate, tui-cs/Terminal.Gui#5630).

API breaks fixed

  • View.Text is no longer virtual (CWP-compliant, Fixes #5366 - BREAKING CHANGE - Make View.Text notifications CWP-compliant and non-virtual Terminal.Gui#5371). Editor.Text was public override; it is now a new property following TextView's pattern: the setter raises TextChanging (cancellable), writes the Document, mirrors into base View via SetTextDirect, and raises TextChanged; an OnTextChanged override syncs the Document when Text is set through a base View reference. Editor also overrides OnDrawingText to suppress the base text pass — the Editor owns all content rendering.
  • Legacy ConfigurationManager / [ConfigurationProperty] / AppSettingsScope / ConfigLocations are deleted. ted's EditorSettings drops the legacy CM attributes (Microsoft.Extensions.Configuration via TuiConfigurationBuilder was already the primary read path); the ConfigTests project's CM end-to-end test is rewritten against TuiConfigurationBuilder + RuntimeConfig with the nested "EditorSettings" shape.
  • Popover is now a screen-filling transparent overlay that positions its ContentView. The completion popup's mouse hit-testing now uses the ListView's screen frame (not the popover's), and mouse-driven accept is handled from the ListView.Accepted event (MouseBinding context) because popup clicks route to the ListView and never reach Editor.OnMouseEvent anymore. Unit tests assert against ContentView geometry.
  • The ANSI driver sizes asynchronously behind the new startup gate, so tests that need deterministic layout geometry now call Driver.SetScreenSize (…) after Init (the pattern AppFixture already used).
  • TG installs its main-loop SynchronizationContext at Init (Fixes #5579. SynchronizationContext is not correctly implemented in v2 Terminal.Gui#5588). ted's sync-over-async bridges (OpenFile/SaveFile/SaveFileAs, plus the startup file load in Program.cs) deadlocked: awaits posted continuations to the very thread being blocked. They now clear the ambient context while blocking (RunSyncBridge), restoring pre-2.5 thread-pool continuation behavior while keeping TextDocument owner-thread handoff on the calling thread.
  • Selector/dropdown width change: the status-bar theme dropdown pads its label to a fixed width in 2.5; the FileMenu_Shortcuts_Snapshot ANSI golden is regenerated (only that glyph run changed).
  • Microsoft.Extensions.Configuration floors raised to 10.0.11 — Terminal.Gui 2.5.0 depends on MEC 10.0.11 and the repo pinned 10.0.7 (NU1605 downgrade errors otherwise).

Known Terminal.Gui 2.5 regression (skipped test — filed as tui-cs/Terminal.Gui#5638)

EditorTabTests.RawAnsi_Tab_After_ShiftTab_Reindents_Line_On_First_Keypress is skipped with a documented reason: AnsiInputProcessor's 50 ms printable-suppression window (dedup of dual-reported keys) swallows a real \t arriving within 50 ms of a parsed Shift+Tab (ESC[Z) — GetPrintableText () is "\t" for both Tab and Shift+Tab. Filed as tui-cs/Terminal.Gui#5638 (closed 2026-08-24 via #5644). Re-enable RawAnsi_Tab_After_ShiftTab_Reindents_Line_On_First_Keypress once confirmed on 2.5.0-develop.55.

Test results

Suite Result
Terminal.Gui.Editor.Tests 579 passed / 0 failed
Terminal.Gui.Editor.IntegrationTests 352 passed / 0 failed / 1 skipped (TG regression above)
Terminal.Gui.Editor.ConfigTests 1 passed / 0 failed

Post-review: EditorTextCwpTests (8 tests) locks the new Text CWP contract both ways — direct and base-View-reference set/get round-trips, single-fire TextChanging/TextChanged, cancellation — and a review fix hardens the setter's re-entrancy flag with a finally (a throwing TextChanged subscriber previously disabled Document sync for all later polymorphic sets; TextView upstream shares this shape).

Debug and Release builds clean; .claude/hooks/cleanup-cs.ps1 (dotnet format + jb cleanupcode) run.

Follow-up

  • Swap the 2.5.0-develop.55 pin to stable 2.5.x (steps at top).
  • Unskip RawAnsi_Tab_After_ShiftTab_Reindents_Line_On_First_Keypress (#5638 is closed; confirm on this pin).

Refs: tui-cs/Terminal.Gui#5416, tui-cs/Terminal.Gui#5630.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

…PI-break port

Temporarily pin to Terminal.Gui 2.5.0-tig-remove-cm-followup.2 from
tui-cs/Terminal.Gui#5416 (built from 5416 head e8aba423) via a vendored
nupkg in local_packages/, until 2.5.x ships on nuget.org (pattern:
tig/winprint#272). Part of the v2.5.0 ecosystem-validation gate
(tui-cs/Terminal.Gui#5630).

Port for 2.5.0 breaking changes:

- View.Text is no longer virtual (CWP, TG #5371): Editor.Text becomes a
  `new` property mirroring TextView's pattern — setter raises
  TextChanging, writes the Document, syncs base via SetTextDirect, and
  raises TextChanged; OnTextChanged override syncs the Document when Text
  is set through a base View reference. OnDrawingText suppresses the base
  text pass (Editor owns rendering).
- ConfigurationManager/[ConfigurationProperty]/AppSettingsScope deleted:
  drop the legacy CM attributes from ted's EditorSettings (MEC is the only
  read path) and rewrite ConfigTests against TuiConfigurationBuilder with
  the nested "EditorSettings" RuntimeConfig shape.
- Popover is now a screen-filling transparent overlay positioning its
  ContentView: completion popup hit-testing uses the ListView's screen
  frame, and mouse-driven Accept is handled from the ListView's Accepted
  event (clicks no longer reach Editor.OnMouseEvent); tests assert
  against ContentView geometry and pin the driver size (ANSI driver now
  sizes asynchronously behind the startup gate).
- TG installs its main-loop SynchronizationContext at Init (TG #5588):
  ted's sync-over-async bridges (OpenFile/SaveFile/SaveFileAs and the
  startup file load) now clear the ambient context while blocking so
  continuations run on the thread pool as before (no deadlock).
- Selector width change: FileMenu_Shortcuts_Snapshot golden regenerated
  (theme dropdown pads its label to a fixed width in 2.5).
- MEC package floors raised to 10.0.11 to satisfy Terminal.Gui 2.5.0.

Known TG 2.5 regression (test skipped, to file upstream):
AnsiInputProcessor's 50ms printable-suppression window swallows a real
Tab arriving within 50ms of a parsed Shift+Tab (ESC[Z).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54b4efb850

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +138 to +139
// Keep base View._text in sync so a polymorphic getter sees the same value.
SetTextDirect (value);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the base Text mirror synchronized with document edits

The mirror is updated only when this new setter is used. If text changes through normal typing, editor.Document.Text, or replacement of Document, neither OnDocumentChanged nor the Document setter calls SetTextDirect, so ((View)editor).Text continues returning the previous value (often the initial empty string). Before this commit the virtual override always returned the live document text, so generic consumers holding the editor as a View now observe stale content; update the mirror on every document change and document swap.

Useful? React with 👍 / 👎.

Comment on lines +127 to +128
// Raise View.TextChanging so subscribers holding a View reference can cancel.
if (OnTextChanging (value))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the no-op behavior for identical Text assignments

When editor.Text is assigned its current value, this setter invokes OnTextChanging, replaces the entire document, and raises TextChanged. This violates the inherited View.Text contract that identical assignments raise neither event, so CWP subscribers now receive a change that did not occur and the document unnecessarily records a full replacement. Compare against the current text before starting the notification workflow.

Useful? React with 👍 / 👎.

Comment thread src/Terminal.Gui.Editor/Editor.cs Outdated
Comment on lines +141 to +143
_ownTextSetterActive = true;
RaiseTextChanged ();
_ownTextSetterActive = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reset the Text setter guard when change handlers throw

If an overridden OnTextChanged or any TextChanged subscriber throws from RaiseTextChanged, _ownTextSetterActive remains true. Subsequent assignments through a View reference then take the early branch in OnTextChanged and stop synchronizing the document, leaving the editor permanently inconsistent until another successful assignment through Editor.Text; reset this guard in a finally block.

Useful? React with 👍 / 👎.

Code review of the tg25 port found the `new Text` setter cleared its
_ownTextSetterActive re-entrancy flag outside a finally: a TextChanged
subscriber that throws left the flag stuck true, silently disabling
Document sync for every later polymorphic (base View reference) Text set.
Reset the flag in a finally. (TextView upstream has the same shape —
worth fixing there too.)

Adds EditorTextCwpTests covering the full CWP contract of the property-
hiding pattern both ways: direct and base-reference set/get round-trips,
TextChanging/TextChanged raised exactly once per path, cancellation
leaving Document and mirror untouched, and the throwing-subscriber
regression (written first; failed before the fix).

Also stamps the skipped Tab-after-Shift+Tab test with the now-filed
upstream issue tui-cs/Terminal.Gui#5638.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84c597a40a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +167 to +171
if (_ownTextSetterActive)
{
base.OnTextChanged ();

return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Synchronize reentrant base Text assignments

When a TextChanged subscriber triggered by editor.Text = "first" reentrantly assigns a different value through a View reference, _ownTextSetterActive is still true, so this branch skips copying that nested base value into the document. The nested setter then raises TextChanged while ((View)editor).Text contains the new value but editor.Text/Document.Text still contains the outer value, leaving the two models inconsistent; suppress the sync only when the base value already matches the document rather than for every callback during the outer setter.

Useful? React with 👍 / 👎.

Swap the 5416 preview nupkg for nuget.org Terminal.Gui 2.5.0-develop.55.
Delete local_packages/, nuget.config, and the .gitignore nupkg exceptions.
Replace leftover ConfigurationManager samples in README with TuiConfigurationBuilder.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

I took over this PR for Terminal.Gui#5630 workstream 4. The branch already sat on current develop, so I did not rebase.

Pin change

The vendored 2.5.0-tig-remove-cm-followup.2 feed is gone. The pin is now public nuget.org Terminal.Gui 2.5.0-develop.55. I deleted local_packages/, nuget.config, and the .gitignore nupkg exceptions. README leftover ConfigurationManager.Enable samples now use TuiConfigurationBuilder.

Local dotnet restore from nuget.org and dotnet build Terminal.Gui.Editor.slnx are green (0 warnings). Test suites are running on this revision (daedacf).

DO NOT MERGE with the pre-release pin in place

This is still a pre-release pin. Before merging:

  1. Update <TerminalGuiVersion> in Directory.Build.props to the public stable 2.5.x.
  2. Confirm there is no vendored feed (local_packages/ and nuget.config are already gone).
  3. Confirm .gitignore has no !local_packages/*.nupkg exceptions (already reverted).
  4. Re-run restore from nuget.org, then build, then Terminal.Gui.Editor.Tests, IntegrationTests, and ConfigTests.

@cursor cursor Bot changed the title Update to TG 2.5.x (PR 5416 preview) Update to TG 2.5.0-develop.55 (do not merge) Sep 3, 2026
Public 2.5.0-develop.55 emits 16-color SGR instead of truecolor RGB for
the same named colors. Glyphs and layout are unchanged. Accept the 11
goldens that captured the old RGB sequences.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

Local suites are green against nuget.org Terminal.Gui 2.5.0-develop.55 at c401c94.

  1. Terminal.Gui.Editor.Tests: 579 passed.
  2. Terminal.Gui.Editor.IntegrationTests: 352 passed, 1 skipped (RawAnsi_Tab_After_ShiftTab_Reindents_Line_On_First_Keypress, still ANSI printable-suppression window swallows real Tab within 50ms of Shift+Tab Terminal.Gui#5638).
  3. Terminal.Gui.Editor.ConfigTests: 1 passed.

I accepted 11 ANSI goldens. ToAnsi on 2.5.0-develop.55 emits 16-color SGR instead of truecolor RGB. Glyphs and layout are the same.

Still do not merge. Swap <TerminalGuiVersion> to public stable 2.5.x first, then re-restore from nuget.org.

cursor Bot pushed a commit to tui-cs/cli that referenced this pull request Sep 3, 2026
Drop the vendored 5416 preview feed (local_packages/, nuget.config,
.gitignore exceptions) and restore Terminal.Gui 2.5.0-develop.55 from
nuget.org. Same pattern as tui-cs/Editor#287. Swap to stable 2.5.x
before merge.

Co-authored-by: Tig <tig@users.noreply.github.com>
Windows/macOS CI still emit truecolor RGB when SupportsTrueColor is
true. Pin Force16Colors so the Linux 16-color goldens match on all
three OS jobs. Also commit the ReSharper line wraps CI flagged in
EditorCompletionTests and EditorTabTests.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

CI on c401c94 failed for two reasons. I pushed 17ece53 to fix both.

  1. Ubuntu ReSharper cleanup: line wraps in EditorCompletionTests and EditorTabTests.
  2. Windows/macOS snapshot mismatches: ToAnsi emits truecolor RGB when SupportsTrueColor is true, and 16-color SGR when it is not. AppFixture now sets Force16Colors = true so the Linux goldens match on all three OS jobs.

Local integration is still 352 passed / 1 skipped. Do not merge while the pin is 2.5.0-develop.55.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17ece53687

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

CompletionSelectedIndex = clickedIdx;
}

AcceptCompletion ();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Prevent completion clicks from bubbling the Accept command

When the editor is hosted where Command.Accept submits a form or closes a dialog, a completion click now has two effects: this handler inserts the completion, while the same ListView.Accepted event is automatically bridged by the 2.5 Popover to its Target (Editor). Thus selecting a suggestion can also raise/bubble Accept on the editor and unexpectedly submit its container; handle the mouse click without invoking the ListView's Command.Accept, or consume it before the popover bridge runs.

Useful? React with 👍 / 👎.

Unselected_Tail_After_Selection_Uses_Normal_Role failed on Ubuntu CI
because Force16Colors collapsed the default Normal and Editable
attributes to the same White/Black pair. The role tests now set an
explicit scheme where those roles differ.

Also handle ListView.Accepting (and mark Handled) for mouse-driven
completion so Popover does not bridge Command.Accept to the Editor.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

Ubuntu CI on 17ece53 failed one test: Unselected_Tail_After_Selection_Uses_Normal_Role. Force16Colors collapsed the default Normal and Editable attributes to the same White/Black pair. The role tests now pin an explicit 16-color scheme where those roles differ.

I also took the Codex P2: mouse-driven completion now handles ListView.Accepting and sets Handled so Popover does not bridge Command.Accept to the Editor.

Pushed 4e5b89f. Local integration is still 352 passed / 1 skipped. Do not merge while the pin is 2.5.0-develop.55.

cursor Bot pushed a commit to tui-cs/mdv that referenced this pull request Sep 3, 2026
Drop the vendored 5416 preview feed (local_packages/ and nuget.config)
and restore Terminal.Gui 2.5.0-develop.55 from nuget.org. Same pattern
as tui-cs/Editor#287. Swap to stable 2.5.x before merge.

Co-authored-by: Tig <tig@users.noreply.github.com>
SetScheme on the role tests leaked a shared scheme into parallel
snapshot tests on Ubuntu CI (16 goldens mismatched). Skip the
precondition instead of pinning colors.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

Ubuntu CI on 4e5b89f failed 16 ANSI snapshots after I pinned distinct roles with SetScheme.

Those goldens passed on the previous Ubuntu run (17ece53, Force16Colors, no scheme pin). Windows and macOS stayed green. Glyphs matched. Only the SGR codes drifted. That is a shared-scheme leak into parallel tests, not a real render change.

2a77584 drops the SetScheme pin. The two role tests now Assert.SkipUnless when Force16Colors collapses Normal and Editable to the same White/Black pair. AppFixture still forces 16-color ToAnsi so goldens stay OS-stable. The completion Accepting/Handled fix is unchanged.

Do not merge. The pin is still public nuget.org 2.5.0-develop.55.

macOS CI NREd in Wcwidth.WideTable.GetTable during
ConfigEditorBackspaceTests.KittyBackspace_DeletesSingleChar.
The 4.0.1 cache does an unlocked Dictionary read next to a
locked insert; parallel Init races that first write.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

Ubuntu and Windows went green on 2a77584. macOS failed one test: ConfigEditorBackspaceTests.KittyBackspace_DeletesSingleChar NREd in Wcwidth.WideTable.GetTable during Application.Init.

That is a parallel-init race in Wcwidth 4.0.1. GetTable reads a Dictionary without the lock, then inserts under the lock. Two inits at once can blow up in Dictionary.FindValue. It is not a Backspace or Editor bug.

9563ba3 warms the latest width table on one thread in the integration-test ModuleInitializer before xUnit starts the suite.

The role-test skip from 2a77584 stands. Do not merge. The pin is still public nuget.org 2.5.0-develop.55.

Same-commit Ubuntu split: push CI passed, PR CI failed 12 goldens
(SGR only). SchemeManager is process-global; parallel Init/SetScheme
swaps Base and flakes ToAnsi. Snapshot classes now share a
DisableParallelization collection. The single-line glyph snapshot
moved into that collection.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

9563ba3 split on Ubuntu: the push run passed, the PR run failed 12 ANSI goldens. Glyphs matched. Only SGR codes drifted. Same commit, so this is a race, not a render change.

SchemeManager is process-global. Parallel Application.Init and SetScheme swap the default Base scheme. Snapshot ToAnsi then disagrees with the golden.

621d4c7 puts every ANSI snapshot class in a DisableParallelization collection so those goldens never overlap that mutation. I also moved SingleLine_Renders_Newlines_As_Glyphs into that collection.

Do not merge. The pin is still public nuget.org 2.5.0-develop.55.

SchemeManager is process-global. Parallel Init/SetScheme leftover
White/Black Base and flakes Ubuntu ToAnsi goldens. Serialize-the-
snapshots made it worse: those tests then ran after other
collections and inherited ASCII Glyphs leftovers.

Capture hardcoded schemes at module init and AddScheme clones
after every AppFixture.Init. Snapshots stay parallel.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

621d4c7 was the wrong fix. Serializing the snapshot classes made them run after the rest of the suite. They then inherited leftover ASCII Glyphs and the Find/Replace dialogs vanished. Local full suite went red.

The real leak is SchemeManager. It is process-global. Parallel Init/SetScheme leaves White/Black on Base ([97m[40m) instead of the golden default ([39m[49m).

c214d20 captures the hardcoded schemes at module init and AddSchemes clones after every AppFixture.Init. Snapshots stay parallel. I ran the integration suite twice here: 353 run, 0 failed, 1 skipped (#5638).

Do not merge. The pin is still public nuget.org 2.5.0-develop.55.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c214d20ad7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


// SchemeManager is process-global. Reset to hardcoded defaults so this test does
// not inherit a Base scheme leftover from a parallel or earlier AppFixture.
TestEnvironment.RestoreHardCodedSchemes ();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid resetting global schemes from every parallel fixture

When ordinary integration-test collections construct AppFixture concurrently, this call rewrites SchemeManager's process-global table while another fixture may be initializing or drawing. RestoreHardCodedSchemes locks only its clone-addition loop, leaves LoadToHardCodedDefaults outside that lock, and cannot synchronize Terminal.Gui readers, so it can reintroduce dictionary races and overwrite state used by tests such as ThemeDropDown_Selection_Changes_Active_Theme. Avoid the per-fixture global reset or isolate the mutation from all parallel collections. CLAUDE.mdL246-L246

Useful? React with 👍 / 👎.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. 07be9f2 drops the per-fixture SchemeManager rewrite. AppFixture now pins a pristine Base clone on EditorTestHost only. Find/Replace still pin Dialog on the dialog itself. No parallel fixture writes the global table.

c214d20 restored SchemeManager at AppFixture.Init. The Find dialog
is Begun later, so a parallel Init can still swap Dialog colors
before draw. Ubuntu PR CI failed that one golden (push was green).

SetScheme a clone of the module-init Dialog scheme on the dialog
itself. Do not serialize the class: that runs it after other
tests and drops the dialog chrome.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

c214d20 split again: push Ubuntu green, PR Ubuntu failed one golden (FindDialog_Shows_Tabs_And_Checkboxes_Below). Glyphs matched. Only SGR drifted.

The Find dialog is Begin'd after AppFixture already restored SchemeManager. A parallel Init can still swap Dialog colors before that draw.

I did not serialize that class. Last time that ran the snapshots after the rest of the suite and the dialog chrome vanished.

ed79cf7 SetSchemes a clone of the module-init Dialog scheme on the dialog itself. Local full suite: 353 run, 0 failed, 1 skipped (#5638).

Do not merge. The pin is still public nuget.org 2.5.0-develop.55.

Codex P2: RestoreHardCodedSchemes from parallel fixtures races
Init/draw and can overwrite ThemeDropDown_Selection_Changes_Active_Theme.
Drop the per-fixture global reset. Pin a pristine Base clone on
EditorTestHost (and Editor) instead. Find/Replace still pin Dialog
on the dialog itself.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex P2 on c214d20 was right. Resetting SchemeManager from every parallel AppFixture is itself a race. It can also overwrite ThemeDropDown_Selection_Changes_Active_Theme.

07be9f2 removes that global reset. I pin a pristine Base clone on EditorTestHost and Editor. Find/Replace still pin Dialog on the dialog. Local full suite: 353 run, 0 failed, 1 skipped (#5638).

Do not merge. The pin is still public nuget.org 2.5.0-develop.55.

Swap the nuget.org floor from 2.5.0-develop.55 to 2.5.0-beta.1.
No vendored feed. Every csproj still uses $(TerminalGuiVersion).

Co-authored-by: Tig <tig@users.noreply.github.com>
tig added a commit to tui-cs/mdv that referenced this pull request Sep 3, 2026
* Update to Terminal.Gui 2.5.x (PR 5416 preview)

Port mdv to the Terminal.Gui 2.5.0 preview built from
tui-cs/Terminal.Gui#5416 (ConfigurationManager removal), as part of the
v2.5.0 ecosystem-validation gate (tui-cs/Terminal.Gui#5630).

- TEMP: vendor Terminal.Gui.2.5.0-tig-remove-cm-followup.1 nupkg/snupkg
  in ./local_packages with a nuget.config source, mirroring
  tig/winprint#272; swap to the public nuget.org package once 2.5.x
  ships.
- Replace deleted ConfigurationManager.Enable (ConfigLocations.All)
  with TuiConfigurationBuilder ().ApplyToStaticFacades ().
- Suppress new CS0618 on TextMateSyntaxHighlighter.GetThemeForBackground
  (obsolete in 2.5; still functional) with a follow-up note.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

* Re-vendor Terminal.Gui preview to followup.2 built from 5416 head e8aba423

followup.1 was built from a stale 5416 commit (93c3b3d4) with real
config-load defects fixed later on the branch: CWD-relative ./.tui
config was silently ignored, and a malformed config crashed before
Main. Verified with followup.2 that a ./.tui/config.json in the launch
CWD now applies (Theme=Light takes effect).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

* chore: pin Terminal.Gui to public 2.5.0-develop.55

Drop the vendored 5416 preview feed (local_packages/ and nuget.config)
and restore Terminal.Gui 2.5.0-develop.55 from nuget.org. Same pattern
as tui-cs/Editor#287. Swap to stable 2.5.x before merge.

Co-authored-by: Tig <tig@users.noreply.github.com>

* chore: pin Terminal.Gui to public 2.5.0-beta.1

Swap the nuget.org pin from 2.5.0-develop.55 to 2.5.0-beta.1.

Co-authored-by: Tig <tig@users.noreply.github.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

I cannot overwrite the PR description from here (it is human-owned). Please drop the "DO NOT MERGE / pre-release pin" section and treat this as the 2.5.0-beta.1 bump.

I set <TerminalGuiVersion> to public nuget.org 2.5.0-beta.1. Restore is from nuget.org. There is no vendored feed and no 2.5.0-develop.* pin. Terminal.Gui.Interop.Spectre is not referenced.

Local results on this pin:

Suite Result
Terminal.Gui.Editor.Tests 579 passed / 0 failed
Terminal.Gui.Editor.IntegrationTests 352 passed / 0 failed / 1 skipped (#5638)
Terminal.Gui.Editor.ConfigTests 1 passed / 0 failed

Build is 0 warnings, 0 errors. I am not merging.

@cursor cursor Bot changed the title Update to TG 2.5.0-develop.55 (do not merge) Update to TG 2.5.0-beta.1 Sep 3, 2026
tig added a commit to tui-cs/cli that referenced this pull request Sep 3, 2026
* chore: update to Terminal.Gui 2.5.0 preview (PR 5416 vendored)

TEMP: pin Terminal.Gui to 2.5.0-tig-remove-cm-followup.1, a preview built
from tui-cs/Terminal.Gui#5416 (ConfigurationManager removal), restored from
a vendored local_packages feed via nuget.config. Part of the v2.5.0
ecosystem-validation gate (tui-cs/Terminal.Gui#5630). No code changes were
required: Terminal.Gui.Cli does not use ConfigurationManager, virtual
View.Text, or IAcceptTarget, and builds warning-free against 2.5.0.

Follow-up: swap to the public 2.5.x package on nuget.org and drop the
vendored feed. Pattern precedent: tig/winprint#272.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

* Re-vendor Terminal.Gui preview to followup.2 built from 5416 head e8aba423

The .1 package was built from a stale #5416 commit (93c3b3d4) that
predated real config-load defect fixes landed later on the branch.
followup.2 is built from the 5416 branch head (e8aba423).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

* chore: pin Terminal.Gui to public 2.5.0-develop.55

Drop the vendored 5416 preview feed (local_packages/, nuget.config,
.gitignore exceptions) and restore Terminal.Gui 2.5.0-develop.55 from
nuget.org. Same pattern as tui-cs/Editor#287. Swap to stable 2.5.x
before merge.

Co-authored-by: Tig <tig@users.noreply.github.com>

* test: regenerate help ANSI goldens for 2.5.0-develop.55

Public Terminal.Gui 2.5.0-develop.55 emits indexed SGR (e.g. ESC[96m /
ESC[40m) instead of the truecolor RGB sequences from the vendored 5416
preview. Glyphs and layout are unchanged; only the color encoding
shifted. Regenerated help.ans and help-browser.ans via UPDATE_SNAPSHOTS.

Co-authored-by: Tig <tig@users.noreply.github.com>

* Revert "test: regenerate help ANSI goldens for 2.5.0-develop.55"

This reverts commit d82e4fc.

* chore: pin Terminal.Gui to 2.5.0-beta.1 from nuget.org

Drop the 2.5.0-develop.55 pin. Restore stays on nuget.org. No vendored
feed.

Co-authored-by: Tig <tig@users.noreply.github.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
ThemeDropDown_Selection_Changes_Active_Theme assigned the process-global
theme and left it there. On Ubuntu CI that leaked into
FileMenu_Shortcuts_Snapshot (colors and the status-bar theme name).
Serialize the mutator and restore the original theme in finally.

Co-authored-by: Tig <tig@users.noreply.github.com>
@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

Ubuntu CI failed on FileMenu_Shortcuts_Snapshot only. Windows and macOS were green.

The glyphs were fine. FileMenu_Shows_Keyboard_Shortcuts passed on the same run. The ANSI golden drifted because ThemeDropDown_Selection_Changes_Active_Theme assigns process-global ThemeManager.Theme and used to leave it there. That rewrites SchemeManager in place. On a busy Ubuntu runner the File menu snapshot then picked up the other theme's colors and sometimes a different status-bar theme name.

I moved that test into its own DisableParallelization collection and restore the original theme in finally. I did not pin Menu/StatusBar schemes on the snapshot. SetScheme on those views changes hotkey colors and would have forced a golden rewrite.

I still cannot overwrite this PR description. Please delete the "DO NOT MERGE with the pre-release pin" section that names 2.5.0-develop.55. The pin is public 2.5.0-beta.1 now.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@cursor

cursor Bot commented Sep 3, 2026

Copy link
Copy Markdown

All 8 checks are green on 099c775, including Ubuntu.

The File menu snapshot race is fixed. The pin is public 2.5.0-beta.1. I still cannot overwrite this description. Please delete the "DO NOT MERGE with the pre-release pin" section that names 2.5.0-develop.55. I have not merged.

@tig
tig merged commit 49d1951 into develop Sep 4, 2026
8 checks passed
@tig
tig deleted the tg25-port branch September 4, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants