Conversation
…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
There was a problem hiding this comment.
💡 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".
| // Keep base View._text in sync so a polymorphic getter sees the same value. | ||
| SetTextDirect (value); |
There was a problem hiding this comment.
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 👍 / 👎.
| // Raise View.TextChanging so subscribers holding a View reference can cancel. | ||
| if (OnTextChanging (value)) |
There was a problem hiding this comment.
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 👍 / 👎.
| _ownTextSetterActive = true; | ||
| RaiseTextChanged (); | ||
| _ownTextSetterActive = false; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
💡 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".
| if (_ownTextSetterActive) | ||
| { | ||
| base.OnTextChanged (); | ||
|
|
||
| return; |
There was a problem hiding this comment.
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>
|
I took over this PR for Terminal.Gui#5630 workstream 4. The branch already sat on current Pin changeThe vendored Local DO NOT MERGE with the pre-release pin in placeThis is still a pre-release pin. Before merging:
|
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>
|
Local suites are green against nuget.org
I accepted 11 ANSI goldens. Still do not merge. Swap |
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>
|
CI on
Local integration is still 352 passed / 1 skipped. Do not merge while the pin is |
There was a problem hiding this comment.
💡 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 (); |
There was a problem hiding this comment.
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>
|
Ubuntu CI on I also took the Codex P2: mouse-driven completion now handles Pushed |
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>
|
Ubuntu CI on Those goldens passed on the previous Ubuntu run (
Do not merge. The pin is still public nuget.org |
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>
|
Ubuntu and Windows went green on That is a parallel-init race in Wcwidth 4.0.1.
The role-test skip from |
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>
|
Do not merge. The pin is still public nuget.org |
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>
|
The real leak is
Do not merge. The pin is still public nuget.org |
There was a problem hiding this comment.
💡 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 (); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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>
|
The Find dialog is I did not serialize that class. Last time that ran the snapshots after the rest of the suite and the dialog chrome vanished.
Do not merge. The pin is still public nuget.org |
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>
|
Codex P2 on
Do not merge. The pin is still public nuget.org |
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>
* 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>
|
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 Local results on this pin:
Build is 0 warnings, 0 errors. I am not merging. |
* 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>
|
Ubuntu CI failed on The glyphs were fine. I moved that test into its own I still cannot overwrite this PR description. Please delete the "DO NOT MERGE with the pre-release pin" section that names |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
All 8 checks are green on 099c775, including Ubuntu. The File menu snapshot race is fixed. The pin is public |
This PR pins Terminal.Gui to public nuget.org
2.5.0-develop.55(<TerminalGuiVersion>inDirectory.Build.props). The Aug 22 vendored2.5.0-tig-remove-cm-followup.2feed is gone (local_packages/andnuget.configdeleted). Before merging:Terminal.Gui2.5.x on nuget.org.<TerminalGuiVersion>inDirectory.Build.propsto that public 2.5.x (the only central pin — every csproj uses$(TerminalGuiVersion)).dotnet restore+ build + all three CI test suites and confirm Terminal.Gui restores from nuget.org with no2.5.0-develop.*pin left.<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 public2.5.0-develop.55(v2.5.0 ecosystem gate, tui-cs/Terminal.Gui#5630).API breaks fixed
View.Textis no longer virtual (CWP-compliant, Fixes #5366 - BREAKING CHANGE - Make View.Text notifications CWP-compliant and non-virtual Terminal.Gui#5371).Editor.Textwaspublic override; it is now anewproperty followingTextView's pattern: the setter raisesTextChanging(cancellable), writes theDocument, mirrors into baseViewviaSetTextDirect, and raisesTextChanged; anOnTextChangedoverride syncs theDocumentwhenTextis set through a baseViewreference.Editoralso overridesOnDrawingTextto suppress the base text pass — the Editor owns all content rendering.ConfigurationManager/[ConfigurationProperty]/AppSettingsScope/ConfigLocationsare deleted. ted'sEditorSettingsdrops the legacy CM attributes (Microsoft.Extensions.Configuration viaTuiConfigurationBuilderwas already the primary read path); theConfigTestsproject's CM end-to-end test is rewritten againstTuiConfigurationBuilder+RuntimeConfigwith the nested"EditorSettings"shape.Popoveris now a screen-filling transparent overlay that positions itsContentView. The completion popup's mouse hit-testing now uses theListView's screen frame (not the popover's), and mouse-driven accept is handled from theListView.Acceptedevent (MouseBindingcontext) because popup clicks route to the ListView and never reachEditor.OnMouseEventanymore. Unit tests assert againstContentViewgeometry.Driver.SetScreenSize (…)afterInit(the patternAppFixturealready used).SynchronizationContextatInit(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 inProgram.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 keepingTextDocumentowner-thread handoff on the calling thread.FileMenu_Shortcuts_SnapshotANSI golden is regenerated (only that glyph run changed).Known Terminal.Gui 2.5 regression (skipped test — filed as tui-cs/Terminal.Gui#5638)
EditorTabTests.RawAnsi_Tab_After_ShiftTab_Reindents_Line_On_First_Keypressis skipped with a documented reason:AnsiInputProcessor's 50 ms printable-suppression window (dedup of dual-reported keys) swallows a real\tarriving 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-enableRawAnsi_Tab_After_ShiftTab_Reindents_Line_On_First_Keypressonce confirmed on2.5.0-develop.55.Test results
Terminal.Gui.Editor.TestsTerminal.Gui.Editor.IntegrationTestsTerminal.Gui.Editor.ConfigTestsPost-review:
EditorTextCwpTests(8 tests) locks thenew TextCWP 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 afinally(a throwingTextChangedsubscriber 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
2.5.0-develop.55pin to stable 2.5.x (steps at top).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