Replies: 3 comments
|
Independent WSL reproduction (WSL2, On WSL the branch is entered through the Window-level matrix (
So the failure is not "Explorer rejects Three notes for the proposed fix, from the WSL side:
The line is still present on |
|
Correction to my own "Suggested fix" — and the comma case is worse than untested Thanks for the WSL reproduction. Two things in it are worth more than a second confirmation:
You were right about the comma, and my proposed fix was wrong for a second reason too. I had suggested gluing
Where I would look next. Keep the path away from explorer.exe's command-line parser entirely — the same reason |
|
Provenance, which I should have stated up front. This report — and the correction above — were drafted by an AI coding agent running on my machine, during the session in which we diagnosed and fixed the problem locally. The reproduction steps, the measured tables and the source citations came from actually running the commands shown; the Limitations sections state what was and was not tested, and the I reviewed it and stand behind the technical content, but please weigh it knowing how it was produced. The local patch in particular has been reviewed by nobody other than the agent and me. |
Uh oh!
There was an error while loading. Please reload this page.
Package:
@deepseek-ai/dsh-native-command(verified on0.1.5-rc.2)Surface: the deliverable card's ▾ menu → "Show in File Explorer" / "在文件资源管理器中显示"
Platform: Windows only (the
manager === "explorer"branch ofrevealNativePath)Summary
Clicking "Show in File Explorer" on a delivered file appears to do nothing. The host request
succeeds, the UI settles on a success state ("Requested display in file manager"), and no Explorer
window becomes visible.
There are two independent defects in the same code path, and both must be fixed:
The Explorer window is created hidden.
revealNativePathspawnsexplorer.exedirectlythrough
runNativeCommand, which hard-codes Node'swindowsHide: true. That flag only hides thedirect child. Elsewhere in the harness this is correct —
openNativePathspawnspowershell.exe, and Explorer is launched by PowerShell, so only the console is hidden. Here thedirect child is
explorer.exe, so the hidden flag lands on the window itself.Non-ASCII paths are percent-encoded before being handed to
/select,. The path is convertedwith
pathToFileURL(windowsPath, { windows: true }).href, which percent-encodes every non-ASCIIsegment.
explorer.exedoes not percent-decode the/select,argument, so the target resolvesnowhere and Explorer silently falls back to opening the Desktop.
Steps to reproduce
Use a workspace path containing non-ASCII characters (e.g.
D:\工作文件\video.mp4).Defect 2, minimal, no harness:
Defect 1, via Node (this is what the harness does):
A
CabinetWClasswindow is created butIsWindowVisible()returns false.Via the product: deliver a file whose path contains non-ASCII, open the card's ▾ menu, choose
"Show in File Explorer".
Measured behaviour
Renaming a directory while a process holds it is not involved here; these are direct observations of
the argv/flag combinations, read back with
EnumWindows+GetWindowText+IsWindowVisible.["/select,", url]file:///D:/%E5%B7%A5...(percent-encoded CJK)["/select," + url]file:///D:/%E5%B7%A5...(percent-encoded CJK)["/select," + path]D:\工作文件\video.mp4["/select," + url]file:///D:/工作文件/video.mp4(not encoded)["/select," + url]file:///C:/Windows/win.ini(ASCII)["/select,", path]D:\工作文件\video.mp4{ windowsHide: true }{ windowsHide: false }Note that splitting
/select,and the path into two argv entries is not the cause — Explorerre-joins them. Fixing only that changes nothing; the path form and the hidden flag are the defects.
explorer.exeexits with code 1 in every case above, including the successful ones, which is why theexisting
error.code !== 1tolerance is reasonable and should stay. The problem is that the exit codecarries no information about where the window landed, so
openWorkspacePathreturns{ opened: true }and the card reports success regardless.Root cause
node_modules/@deepseek-ai/dsh-native-command/lib/index.js, theexplorerbranch ofrevealNativePath:and in
runNativeCommand:Suggested fix
Pass a single argv token containing a plain Windows path, not a URL:
The
%2Cescaping exists only because a comma is meaningful inside afile://URL; with a plainpath it is unnecessary.
Give
runNativeCommanda way to opt out of hiding, defaulting to today's behaviour so the consolelaunchers are unaffected:
(An alternative worth considering is routing the reveal through the same
openNativePathPowerShell path the working "Open locally" button uses, since that path is already proven correct
for non-ASCII directories.)
With both changes applied locally,
revealNativePathwas verified end to end on Windows: the newwindow is
Visible = True, titled with the target folder, andDocument.SelectedItems()contains therequested file.
Additional note: the fix cannot be carried across versions
This deserves a mention because it determines how the fix can be delivered at all.
The only way to apply it today is to edit the installed file under
%LOCALAPPDATA%\npm-cache\_npx\<hash>\node_modules\@deepseek-ai\dsh-native-command\lib\index.js.That
<hash>directory is a function of the resolveddshversion: when the harness moved from0.1.5-rc.1to0.1.5-rc.2a new_npxdirectory appeared and the patched copy was silentlyleft behind in the old one — the bug came back with no signal to the user.
So the fix really needs to land upstream; until then every upgrade silently reverts it. If a supported
way to override a bundled package is out of scope, it would still help to document explicitly that
patching under
_npxis unsupported and is discarded on version change.Limitations of this report
0.1.5-rc.2tree. Not tested on macOS/Linux (finder/directorybranches are separate).windowsHidebehaviour was measured withCreateProcess'sCREATE_NO_WINDOW; I did not tracefurther into how
explorer.exehonours it.reporter's machine.
All reactions