Hide the GUI host from Windows Terminal - #112
Merged
Merged
Conversation
Win11 default terminal turns Reclaim11.cmd into an empty black WT window; WindowStyle Hidden does not apply. cmd hops to Reclaim11.vbs (Run 0) and STA/UAC relaunch uses ShellExecute SW_HIDE.
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently implement the intended “no lingering Windows Terminal window” behavior and update packaging/tests accordingly.
Pull request overview
This PR updates the Reclaim11 “double-click” launch path to avoid Windows Terminal (25H2 default console host) leaving behind an empty black window when launching a hidden PowerShell UI, by hopping through a GUI host (VBS) and using SW_HIDE for STA/UAC relaunch.
Changes:
- Add
Reclaim11.vbsand updateReclaim11.cmdto launch viawscript.exe(hidden, no lingering WT window). - Update
Reclaim11.ps1to relaunch viaShellExecute(..., SW_HIDE)for STA/admin elevation instead ofStart-Process -WindowStyle Hidden. - Update kit builders and VM-only tests to require the VBS to be included in USB/zip kits and enforce the new hop.
File summaries
| File | Description |
|---|---|
| scripts/Test-Reclaim11.ps1 | Extends VM-only kit validation to require the new VBS hop and SW_HIDE relaunch behavior. |
| scripts/New-Reclaim11WinPeUsb.ps1 | Copies Reclaim11.vbs into the USB kit payload. |
| scripts/New-Reclaim11KitZip.ps1 | Includes Reclaim11.vbs in the staged kit zip and validates it as required input. |
| godbrain_core/reclaim11/Reclaim11.vbs | New VBS launcher that runs the GUI PowerShell host hidden via Wscript.Shell.Run ... , 0. |
| godbrain_core/reclaim11/Reclaim11.cmd | Updates the double-click door to hop to wscript.exe when VBS exists, exiting quickly so WT closes. |
| godbrain_core/reclaim11/README.md | Documents that the .cmd now hops to a hidden host to avoid the WT black window behavior. |
| godbrain_core/reclaim11/ps1/Reclaim11.ps1 | Adds Start-Reclaim11HiddenHost using Shell.Application.ShellExecute with SW_HIDE for STA/UAC relaunch. |
Review details
Suppressed comments (1)
scripts/Test-Reclaim11.ps1:139
$launchSrc -notmatch 'ShellExecute'can be satisfied by a comment string and won’t guarantee the GUI relaunch path actually calls the COM method. Matching the call-site pattern (e.g..ShellExecute() makes this test assertion more robust.
if ($launchSrc -notmatch 'ShellExecute') {
throw "Test-Reclaim11: GUI path must UAC-relaunch via ShellExecute"
}
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+59
to
+64
| if ($cmdSrc -notmatch 'wscript\.exe') { | ||
| throw "Test-Reclaim11: Reclaim11.cmd must hop to wscript (WT swallows .cmd)" | ||
| } | ||
| if ($cmdSrc -notmatch 'Reclaim11\.vbs') { | ||
| throw "Test-Reclaim11: Reclaim11.cmd must launch Reclaim11.vbs" | ||
| } |
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.
On 25H2 the default console host is Windows Terminal. Double-click
Reclaim11.cmdthenstart pwsh -WindowStyle Hiddenopens an empty black WT window; Hidden does not apply.Reclaim11.cmdhops toReclaim11.vbs(wscript,Run 0) and exits so WT closes.ShellExecuteSW_HIDE instead ofStart-Process -WindowStyle Hidden.Not CS2. Not the kernel. Test-Reclaim11 stays VM-only.