Windows: revealNativePath silently reveals nothing — windowsHide: true hides the Explorer window it spawns #7898
Replies: 1 comment
|
Your diagnosis looks correct. The visibility issue has also been independently reproduced in earlier reports: I think the narrowest fix is the one you suggested: keep That avoids changing the behavior of I would also treat the unconditional acceptance of Explorer exit code 1 separately. Even if exit 1 is commonly the delegated-shell path, accepting every such exit as success makes genuine failures indistinguishable from a successful handoff. At minimum, logging stderr/context there would make this much easier to diagnose. So yes — this looks like a Windows reveal-path bug rather than a path-resolution problem, and a per-call visibility override seems like the minimal fix. |
Uh oh!
There was an error while loading. Please reload this page.
Title
Windows:
revealNativePathsilently reveals nothing —windowsHide: truehides the Explorer window it spawnsAffected
@deepseek-ai/dsh-native-command@0.1.5-rc.3, still present in0.1.7-rc.2(published 2026-09-24; verified bydownloading the published tarball and reading
lib/index.js).Environment: Windows 10 19045, Node 24.15.0,
dsh@0.1.5-rc.3,dsh web.Symptom
Deliverables card → menu → "Show in File Explorer" reports success (the card shows
"已请求在文件资源管理器中显示" / "Requested display in file manager", i.e.
POST /api/present.open?...&action=revealreturned 204), but no Explorer window appears.
Root cause
runNativeCommandspawns every host command withwindowsHide: true(
lib/index.js:17-22in 0.1.5-rc.3;lib/index.js:18-37in 0.1.7-rc.2). On Windows Node maps that toSTARTUPINFO.wShowWindow = SW_HIDE(plusCREATE_NO_WINDOW). That is the right default for the console helpersthis runner was written for (
reg.exe,powershell.exe,wslpath), butexplorer.exeis a GUI process: thewindow it creates exists yet is never shown.
Measured on the same command with only that flag changed:
IsWindowVisiblewindowsHide: trueShell.Application.Windows())windowsHide: falseThe process starts and exits normally, so the route reports success.
Repro (self-contained; opens at most 2 windows)
The window is present with
visible=False; repeat with{windowsHide:false}and it reportsvisible=True.Secondary issue that makes the failure silent
runExploreraccepts anyexplorer.exeexit 1 as a successful delegated handoff(
lib/index.js:233in 0.1.5-rc.3;lib/index.js:146in 0.1.7-rc.2). A genuine failure therefore also returns 204and the UI claims success. Distinguishing real failures (or at least logging stderr) would have surfaced this bug
immediately instead of presenting it as success.
Suggested fix
Give the runner a per-call override, and keep the GUI launcher visible:
then at the
explorer.execall site — in 0.1.7-rc.2 there is now exactly one, insiderunExplorer, which servesboth open and reveal:
In 0.1.5-rc.3 the site is
await run("explorer.exe", ["/select,", target], signal);.Alternatively, route
explorer.exethrough the visibility policydsh-host-open-in-appalready applies(
launchDetachedApppasseswindowsHide: options.windowsHide, false for GUI adapters) — the codebase has theconcept; only the generic runner lacks it.
Scope
Windows only — macOS
open -Rand Linuxxdg-openare unaffected. In 0.1.7-rc.2 the blast radius is wider:openWindowsPathnow also goes throughrunExplorer, so "open in default application" would open invisibly aswell, not just "show in file manager".
Why it may have been missed
The comments assume
explorer.exehands the request to the already-running desktop process and exits 1; on thatpath the window is created by the shell process and stays visible. The hidden-window case needs the spawned
explorer.exeto create the window itself, as it does on this machine. Linux/macOS CI would not exercise it.Unrelated but worth noting: the new
explorerTarget()escaping work in 0.1.7-rc.2 (commas, equals signs,non-ASCII percent-escapes,
\\?\prefixes) is exactly the kind of care this call site needs — the command linewas never the problem.
All reactions