Skip to content

Update to TG 2.5.x (PR 5416 preview) - #30

Open
tig wants to merge 2 commits into
developfrom
tg25-port
Open

Update to TG 2.5.x (PR 5416 preview)#30
tig wants to merge 2 commits into
developfrom
tg25-port

Conversation

@tig

@tig tig commented Aug 22, 2026

Copy link
Copy Markdown
Member

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

This PR pins a vendored pre-release build (Terminal.Gui 2.5.0-tig-remove-cm-followup.2, built from tui-cs/Terminal.Gui#5416 head e8aba4230) so the port can be validated ahead of the v2.5.0 release. Before merging, once a public 2.5.x package is on nuget.org:

  1. Update the Terminal.Gui pin to the public 2.5.x version in: Directory.Packages.props
  2. Delete local_packages/ and the tgui-pr-5416 package source in nuget.config
  3. Re-run build and tests and confirm Terminal.Gui restores from nuget.org

(No .gitignore change is needed: nothing in .gitignore covers local_packages/.)


Ports PSTui 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). Pattern precedent: tig/winprint#272.

TEMP: vendored package pin

Terminal.Gui 2.5.x is not on nuget.org yet, so this PR vendors a preview nupkg built from the PR 5416 branch:

  • local_packages/Terminal.Gui.2.5.0-tig-remove-cm-followup.2.nupkg (+ .snupkg) committed to the repo — built from PR 5416 head e8aba4230 with an explicitly set version (GitVersion had produced the same followup.1 version string for different commits, which is how a stale build got vendored the first time)
  • nuget.config gains a tgui-pr-5416 source pointing at ./local_packages
  • Directory.Packages.props pins Terminal.Gui to 2.5.0-tig-remove-cm-followup.2

All three carry TEMP comments. Follow-up: once 2.5.x is published to nuget.org, swap the pin to the public version and delete local_packages/ plus the extra nuget source.

Code changes (2.5.0 API breaks fixed)

  • ConfigurationManager / ConfigLocations removedTuiConfigurationBuilder:
    • OutConsoleGridView.StartUi: ConfigurationManager.AppName = "Out-ConsoleGridView"; ConfigurationManager.Enable(ConfigLocations.All);new TuiConfigurationBuilder("Out-ConsoleGridView", currentDirectory).ApplyToStaticFacades();
    • ShowObjectView.Run: ConfigurationManager.Enable(ConfigLocations.All)new TuiConfigurationBuilder("Show-ObjectTree", currentDirectory).ApplyToStaticFacades(); (explicit app name matters here — the entry assembly is pwsh, so app-scoped ./.tui/<cmdlet>.config.json discovery needs it)
    • Both cmdlets pass the PowerShell session's current filesystem location (SessionState.Path.CurrentFileSystemLocation) through ApplicationData.CurrentDirectory into the builder's currentDirectory parameter: pwsh does not sync the process working directory with Set-Location, so without this, ./.tui/ config discovery would resolve against wherever pwsh was launched rather than the user's current location
    • OutGridViewWindowIntegrationTests: dropped the Enable call — 2.5 applies configuration (library defaults, ~/.tui, ./.tui, TUI_CONFIG) automatically at assembly load via TuiConfigurationBuilder.Shared
    • New TuiConfigurationTests (4 tests) pin the config-discovery contract the cmdlets rely on: CWD-relative and explicit-directory discovery of ./.tui/config.json and ./.tui/Out-ConsoleGridView.config.json, and no-throw fallback on malformed config files. The two CWD tests fail against the original followup.1 vendored build (it resolved ./.tui/ against AppContext.BaseDirectory — pwsh's install directory — a regression vs 2.4.x fixed upstream in the PR 5416 branch), which is why the vendored package was rebuilt from the branch head.
  • No other 2.5.0 breaks hit: PSTui has no View.Text overrides, no IAcceptTarget usage, and ships no config.json

Verification

  • dotnet build: clean, Debug and Release (only pre-existing warnings)
  • Clean-cache dotnet restore confirmed to resolve Terminal.Gui from ./local_packages
  • Invoke-Build -Configuration Release Clean, Build, Test (what CI runs): 82/82 xUnit passed, 20/20 Pester passed, module packaging (PSTui + Terminal.Gui closure, 26 assemblies — including the Microsoft.Extensions.Configuration.* closure 2.5 adds, derived automatically from deps.json) succeeded
  • In-host probe: real pwsh session, Set-Location to a directory containing .tui/Out-ConsoleGridView.config.json with "Theme": "Dark" → the migrated call discovers and applies it while the process CWD points elsewhere

🤖 Generated with Claude Code

https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL

tig and others added 2 commits August 22, 2026 17:21
…tionManager

Bump Terminal.Gui 2.4.10 -> 2.5.0-tig-remove-cm-followup.1, a preview build
of tui-cs/Terminal.Gui#5416 (ConfigurationManager removal), TEMP-vendored in
./local_packages via a "tgui-pr-5416" nuget.config source until 2.5.x ships
on nuget.org.

API migration:
- ConfigurationManager.AppName/Enable(ConfigLocations.All) ->
  new TuiConfigurationBuilder("<cmdlet>").ApplyToStaticFacades() in
  OutConsoleGridView and ShowObjectView (config is now also auto-applied at
  assembly load via TuiConfigurationBuilder.Shared).
- Drop the redundant Enable call in OutGridViewWindowIntegrationTests.

Part of the v2.5.0 ecosystem-validation gate (tui-cs/Terminal.Gui#5630).
Pattern precedent: tig/winprint#272.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BVbLXNzbus2MTXmiJDBErL
The vendored Terminal.Gui 2.5.0-tig-remove-cm-followup.1 was built from
tui-cs/Terminal.Gui@93c3b3d40, five commits behind the PR 5416 head, and
predated that branch's ultrareview fixes. In that build ./.tui/ config
paths resolve against AppContext.BaseDirectory (pwsh's install directory
for this module), so the GlobalCurrent and AppCurrent config locations
that 2.4.x resolved against the process working directory were silently
dead - contradicting the port's own comments.

Test-first fixes:
- New TuiConfigurationTests pin CWD-relative discovery of
  ./.tui/config.json and ./.tui/Out-ConsoleGridView.config.json (both
  failed against followup.1), explicit-currentDirectory discovery, and
  no-throw fallback on malformed config files.
- Re-vendor Terminal.Gui 2.5.0-tig-remove-cm-followup.2 built from the
  PR 5416 head (tui-cs/Terminal.Gui@e8aba4230) with an explicitly set
  version, so the stale-cache collision GitVersion caused (same
  followup.1 version for different commits) cannot recur.
- Pass the PowerShell session's current filesystem location
  (SessionState.Path.CurrentFileSystemLocation) through ApplicationData
  to TuiConfigurationBuilder's new currentDirectory parameter: pwsh does
  not sync the process working directory with Set-Location, so without
  this ./.tui/ discovery used wherever pwsh was launched, not where the
  user cd'd.

Verified: Invoke-Build -Configuration Release Clean, Build, Test - 82/82
xUnit, 20/20 Pester, 26 assemblies packaged; clean-cache restore from
./local_packages; in-host pwsh probe confirms ./.tui/<cmdlet>.config.json
now applies from the session's cd location.

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

1 participant