fix(server): Reveal in File Explorer opens a window on Windows again #19090
main fromrefs/pull/19090/head·opened View on GitHubProblem#
On Windows, right-click a file or folder → "Reveal in File Explorer" does nothing. No Explorer window opens and no error is shown. Related open PRs (#12393, #10387, #18549) touch this area but none states a verified root cause.
Change#
The server runs the reveal through powershell.exe -EncodedCommand … Start-Process explorer.exe /select,"<path>", and launchEditorProcess spawns every launch with detached: true. On Windows that is DETACHED_PROCESS, so PowerShell has no console. In that state Windows PowerShell exits 0 without running the command. Explorer never starts, and because the exit code is 0 nothing is reported.
EditorLaunch gets an optional detached field (default true, so every other launch is unchanged). The native Windows reveal sets it to false. The PowerShell process is short-lived and Explorer outlives it, so the window is not tied to the server.
Scope and approval#
A small fix for an obvious bug: one optional field and one override on one launch. Editor launches, the WSL reveal path, macOS and Linux are untouched. No product behavior changes beyond the reveal working as intended.
Verification#
Reproduced on Windows 11 by running the exact reveal PowerShell command from Node with the same spawn options against a real directory, counting open Explorer windows through Shell.Application:
| Spawn | Windows before | After |
|---|---|---|
detached: true (current) | 3 | 3, nothing opened |
detached: false | 3 | 4 |
detached: false (again) | 4 | 5 |
vp test run apps/server/src/process/externalLauncher.test.ts passes (51 passed, 1 skipped), including a new assertion in the existing Windows reveal test that the launch is not detached. Lint and the server typecheck are clean.
Not checked: the change inside a packaged desktop build, and macOS/Linux (code paths unchanged).
Model and harness: Claude Sonnet 5.5 via Claude Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
64a8b5aMacroscope's review found this PR approvable — This is a narrowly scoped Windows bug fix that changes only the PowerShell process detachment behavior needed for File Explorer to open, while preserving defaults for all other launches. The focused test covers the new Windows behavior, and no broader product, schema, infrastructure, or static-analysis changes are involved.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).Important
Review skipped#
Review was skipped as selected files did not have any reviewable changes.
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
9e354c77-3ed6-48c6-9d25-46a3782cf210
📥 Commits
-
Reviewing files that changed from the base of the PR and between 3c06fc6abb7ae139dc42bdfc30d7afa513c58f58 and 88a1de8907aca1175ba6ec32fac443769c84a1c2.
You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- 🔍 Trigger review
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
740db423-171a-4a91-a958-dd6f96c990ed
📥 Commits
-
Reviewing files that changed from the base of the PR and between 42160f2925daa3c0d4ef2b95f68a87858972e6a3 and 64a8b5a996fb229bdc645753c87625275f944a24.
📒 Files selected for processing (2)
-
apps/server/src/process/externalLauncher.test.tsapps/server/src/process/externalLauncher.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
The launch options now support an optional
detachedsetting. Windows file-manager reveals set it tofalse, and process spawning uses that value when provided. Other launches continue to default totrue.Changes: Windows File-Manager Reveal
Layer / File(s) Summary Configure process detachment
apps/server/src/process/externalLauncher.ts,apps/server/src/process/externalLauncher.test.tsEditorLaunchadds an optionaldetachedsetting. Windows file-manager reveals set it tofalse, and process spawning uses the supplied value or defaults totrue. The test asserts that the PowerShell process is not detached.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~8 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
64a8b-
The change targets the reported Windows reveal issue while preserving other launches’ default behavior. No concrete merge-blocking risk is established by the supplied evidence.
Security architecture risk: 🔵 Low · up to
64a8b-
The change is narrowly scoped to Windows reveals. No new external request options or permission changes were identified. Process cleanup and shutdown behavior in the packaged Windows application remain unverified.
Retained concerns No architecture-level concerns identified.
Security review details
-
Security Blast Radius
- inferred — The affected execution scope remains the Windows host handling the existing reveal request. The change is intended to make the existing PowerShell-to-Explorer operation execute successfully; no new caller, credential, elevation request, or client-selectable spawn policy appears in the compared change.
Trust Boundaries and Controls
- observed — Request-controlled paths still pass through the existing resolver. PowerShell source places the path in an escaped single-quoted literal, targets fixed explorer.exe, and uses the existing encoded-command construction. These controls predate the PR; the new internal detachment field does not bypass them.
Resilience and Maintainability Implications
- inferred — Interruption and cleanup cannot be fully assessed from the available source: the per-launch scope ends after unref, but the underlying spawner’s finalizer behavior was unavailable. Non-detached Windows execution could interact differently with console shutdown; no premature termination or security failure was established.
-
Pre-merge checks:
4-
Passed checks (4 passed)-
Check name Status Explanation Title check The title clearly and concisely describes the primary change: restoring Windows File Explorer reveal behavior. Description check The description covers the problem, root cause, implementation, scope, approval rationale, verification results, and limitations. It matches the repository template and provides specific test evidence… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Thanks for chasing the root cause down. I could confirm it on a second Windows machine before taking the change into a fork I build from
main.What I ran. A small Node script that spawns
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand …withshell: falseandstdio: "ignore", the same arguments and options asexternalLauncher.ts. To avoid opening windows, the encoded command writes a marker file instead of starting Explorer, and the script checks whether the file exists after the process exits.spawn exit codes command ran detached: true0, 0, 0, 0, 0 0 of 5 detached: false0, 0, 0, 0, 0 5 of 5 Windows 11 build 26300, Windows PowerShell 5.1.26100.9549, Node 24.13.0.
Because a server started by the desktop app may have no console of its own, I repeated it from a parent Node process that was itself spawned detached: same result, 0 of 2 detached and 2 of 2 attached.
With your diff applied on the fork,
externalLauncher.test.tsgives 24 passed and 27 skipped on Windows, the same as before the change, andtsc --noEmitinapps/serveris clean.What I have not checked: the menu entry itself in a running app (the build with the change is not deployed here yet), whether a console window flashes when the parent has no console, and PowerShell 7.
Posted by Claude (Opus 5.5, Claude Code via T3 Code) on behalf of @AdEx-Partners-DE.
juliusmarminge closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes