Conversation
…tionManager Port clet to the Terminal.Gui 2.5.0 preview built from tui-cs/Terminal.Gui#5416 (ConfigurationManager removal). 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.2 in ./local_packages (nuget.config source "tgui-pr-5416"); swap to the public package once 2.5.x ships on nuget.org (pattern: tig/winprint#272). - Replace ConfigurationManager / [ConfigurationProperty] with a new CletConfiguration wrapper around TuiConfigurationBuilder ("clet"). - EditorSettings / FileAccessSettings: bind from nested config sections; JSONC-preserving Save now writes the nested "EditorSettings" object. - ConfigClet: validate syntax via JsonDocument, surface TuiJsonErrors, and explicitly reject unknown "Theme" values (the MEC loader ignores them). - Default config template rewritten to the nested 2.5+ shape (dotted top-level keys are treated as legacy and skipped). - Work around a TG 2.5 preview deadlock: RunAsync hangs when invoked after an await that resumed on an ambient SynchronizationContext (ConfigureAwait (false) on the pre-UI file read). - Rewrite Clet.ConfigTests for the MEC-based configuration; drop the CM reflection proxies. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL
This was referenced Aug 23, 2026
…ng line comment FindLastJsonTokenPosition treated only whole-line comments as comments, so when the insertion point's preceding value carried a trailing // comment, the separating comma was inserted inside the comment text and the required comma after the value was lost — Save produced invalid JSON that the configuration loader then rejected. Now the helper detects trailing line comments (string-aware, so URLs like the $schema value are unaffected) and places the comma directly after the value. Covers both insertion paths: appending missing keys inside an existing "EditorSettings" section and inserting the whole section at the top level. Test-first: Save_SectionEndsWithTrailingLineComment_ProducesValidJsonc and Save_TopLevelEndsWithTrailingLineComment_ProducesValidJsonc failed before the fix (JsonNode.Parse threw on the written file) and pass after. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL
The deadlock found during PR 5416 validation is now filed upstream as tui-cs/Terminal.Gui#5636; point the workaround comment at the issue. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR pins a vendored pre-release —
Terminal.Gui 2.5.0-tig-remove-cm-followup.2, built from tui-cs/Terminal.Gui#5416 (heade8aba423) and committed as.nupkg/.snupkgfiles underlocal_packages/. Before merging:Directory.Build.props(TerminalGuiVersion; the only place the version is pinned —src/Clet/Clet.csprojreferences$(TerminalGuiVersion)).local_packages/and remove thetgui-pr-5416package source fromnuget.config(delete the file if nothing else needs it)..gitignoreexception forlocal_packages/*.nupkg/*.snupkg(theTEMP:block at the end of.gitignore).dotnet restore && dotnet build, then the four test projects) and confirm the restore pulls Terminal.Gui from nuget.org, not a local feed.What this PR does
Ports clet to the Terminal.Gui 2.5.0 preview (ConfigurationManager removal). Part of the v2.5.0 ecosystem-validation gate tui-cs/Terminal.Gui#5630; TG changes come from tui-cs/Terminal.Gui#5416. Vendored-package pattern precedent: tig/winprint#272.
API breaks fixed (2.4.5 → 2.5.0 preview)
ConfigurationManager,ConfigLocations,[ConfigurationProperty],SettingsScopeare deleted. Replaced with a newCletConfigurationstatic wrapper aroundTuiConfigurationBuilder ("clet"):Apply ()at startup (Program.Main) pushes TG settings to the static facades and binds clet's own sections;Reload ()re-reads all sources after a config file changes (also reloadsTuiConfigurationBuilder.SharedsoThemeManagersees new themes).[ConfigurationProperty]reflection discovery is gone.EditorSettingsandFileAccessSettingsnow bind explicitly from the nested"EditorSettings"/"FileAccessSettings"sections (IConfigurationindexer reads — AOT/trim-safe, no binder reflection). TheClet.ConfigTestsCM reflection proxies are deleted."EditorSettings.LineNumbers","Key.Separator", …) are detected as legacy and silently skipped by TG 2.5. clet's default config template, the JSONC-preservingEditorSettings.Save, andFileAccessSettings.AddToConfigall now read/write the nested shape ("EditorSettings": { "LineNumbers": … }). Existing user configs with dotted keys are ignored by TG (with a log warning), not migrated.ConfigurationManager.ThrowOnJsonErrors/ throwingLoad+Applyare gone. The MEC loader never throws; per-source errors land inTuiJsonErrors.ConfigCletnow: (1) checks JSON syntax withJsonDocumentso errors keep line/column info for the editor jump-to-error UX, (2) drainsTuiJsonErrorsafter reload, and (3) explicitly validates the"Theme"value againstThemeManager.GetThemeNames ()— the 2.5 loader silently ignores unknown themes, which would have regressed clet's bad-theme error dialog.View.Textnon-virtual (no overrides),IAcceptTargetnamespace move (no direct references).Upstream findings (for the 2.5.0 gate)
IApplication.RunAsyncdeadlocks when called after anawaitthat resumed on an ambientSynchronizationContext(e.g. xunit's) — filed as IApplication.RunAsync deadlocks after await on ambient SynchronizationContext Terminal.Gui#5636. The run loop never completes; the input thread spins forever.await ….ConfigureAwait (false)beforeRunAsyncavoids it; TG 2.4.5 did not have this. Worked around inConfigClet.RunAsync(commented at the call site). Repro:Clet.IntegrationTests.ConfigCletIntegrationTests.RunAsync_WithBadTheme_StopAfterFirstIteration_ReturnsOkwith theConfigureAwait (false)removed.LinearRangelegend rendering regression — filed as LinearRange legend renders stray characters (regression vs 2.4.5) Terminal.Gui#5637: the legend row rendersFreenProbrTeaminstead ofFree Pro Team— stray literal characters drawn with the set-option attribute in the legend spacing cells. Repro:Clet.UITests.CletUiTests.LinearRangeClet_InitialRender_MatchesAnsiGolden(labelsFree,Pro,Team)."Theme"values are silently ignored by the MEC loader (old CM threw). Apps that surfaced bad-theme errors must re-implement validation (clet now does).Test results (Windows, local; CI runs ubuntu/macos/windows)
Clet.UnitTestsClet.ConfigTests(rewritten for MEC)Clet.IntegrationTestsClet.SmokeTestsClet.UITests(golden renders; not run in CI)develop+ TG 2.4.5, env-dependent goldens); 4 new under 2.5: 3 are benign style diffs (Date/Time/Duration field cursor now underlined instead of inverse) and 1 is the realLinearRangeregression above. Goldens intentionally not regenerated — that would bake in an upstream rendering bug and machine-dependent output.dotnet format --verify-no-changes(CI style gate) andclet --helpprocess smoke: ✅. Release build: ✅ zero warnings.Follow-up
☒→☑changes) and theLinearRangelegend regression is fixed upstream.Terminal.Gui.Editor(2.5.1) andTerminal.Gui.Cli(0.1.0-develop.7) pins deliberately untouched — those repos are being ported separately.🤖 Generated with Claude Code
https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL