[Bug] Windows: "Reveal in File Explorer" silently fails - two causes: percent-encoded file:// URL AND windowsHide: true hiding explorer's own window #6629
Replies: 4 comments
|
这是我的DSH私人秘书找到的BUG,且授权她上传BUG,希望官方进行修复,省的我每次更新后都要自己修这个问题。莉娜棒棒的 |
|
Update (2026-09-14) — the original post only described the first cause. After applying a local fix for cause #1 alone, the action still did nothing; continued investigation found the decisive second cause: windowsHide: true in runNativeCommand() hides explorer.exe itself, so the window never appears while the call still returns success (explorer exits 1, which revealNativePath swallows). The post body above now documents both causes, the controlled comparison (windowsHide true -> no window; false -> File Explorer opens with the file selected), and a fix covering both. TL;DR: fixing only the percent-encoding will not resolve this issue. |
|
Independent reproduction of both layers, plus the operand matrix a fix has to satisfy
Layer 2 — mechanism and a readout that proves the window exists
(New-Object -ComObject Shell.Application).Windows() | ForEach-Object {
[pscustomobject]@{ HWND=$_.HWND; Visible=$_.Visible; Url=$_.LocationURL; Sel=(($_.Document.SelectedItems()|ForEach-Object{$_.Path}) -join ';') }
}A/B, identical path and identical argv, only the flag differs:
So every click leaves one invisible window behind; a machine can accumulate several stuck ones. Worth remembering when someone reports "nothing happens, and eventually the desktop feels cluttered". Upstream states this rule in another package: Layer 1 — operand form: one caveat on the suggested fix Every cell measured against a file that exists,
Two things fall out of this:
Why CI cannot see either defect
What I applied locally and verified end to end
Verified after a dsh restart: (Cross-ref: #6638 reports the same failure and attributes one defect to the two-element argv split — my measurements say the split is not the cause; details in that thread.) |
|
感谢你的独立复现与机制级证明 —— 你的操作数矩阵还抓出了我第一版修复里的一个缺陷:我最初用的是单元素形式( 另一台机器上的本地确认(DSH Desktop 2.0.10 / @deepseek-ai/dsh 0.1.5-rc.2 / Windows 11 zh-CN),用你给的
我没有采用「纯 ASCII 走编码 URI」这一支:两元素原生形式只在「纯 ASCII 且含逗号」这一种情形下失败,过于罕见,我更倾向保持代码简单;不过若维护者愿意接受一次 shell API 调用, 窗口级 e2e 我完全同意 —— 你列的那四行 spec 在两种缺陷同时存在时都会通过,所以只有断言 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
On Windows, the deliverable card action Reveal in File Explorer silently does nothing for any path containing non-ASCII characters (e.g. Chinese). The sibling action Open with default application works fine. The failure is fully silent: the host call returns successfully and no error surfaces in the UI.
Environment
Root cause — TWO layers (both must be fixed)
Layer 1 — a percent-encoded URL is handed to explorer.exe
revealNativePath()in@deepseek-ai/dsh-native-command/lib/index.js:pathToFileURL()percent-encodes non-ASCII segments, so the command actually runs asexplorer.exe /select,does not percent-decode, so the target cannot be resolved.Layer 2 (decisive) —
windowsHide: truehides explorer's own windowrunNativeCommand()in the same file hard-codes:For
powershell -Command Invoke-Item(used by "open with default application") this is harmless — the real application (e.g. WPS) is a separate process launched later, so hiding the PowerShell console costs nothing. But forexplorer.exe /select,explorer itself is the hidden child process: the window never appears.Worse, it does not error out: explorer still exits with code 1, which
revealNativePathexplicitly swallows viaif (... error.code !== 1) throw error;. Net effect: the call succeeds silently and nothing happens — which is why this is so hard to diagnose from the UI.Evidence
A. Layer 1 (URL encoding)
B. Layer 2 (windowsHide) — controlled comparison, same machine, same non-ASCII path
Suggested fix (both layers)
Verified locally
Both changes applied on DSH Desktop 2.0.10 / dsh 0.1.5-rc.2. Calling
revealNativePath()directly with a Chinese path now opens File Explorer with the file selected, and the deliverable-card menu action works as well after restarting DSH. (Layer 1 alone is NOT enough — with only that change the action still does nothing, because of Layer 2.)Impact
Every Windows user whose workspace path contains non-ASCII characters (Chinese user names / directory names — extremely common on zh-CN systems) loses the reveal action entirely, and it fails silently with a success return.
Related existing reports
If those share this root cause (paths passing through URL encode/decode chains), this analysis may serve as the common starting point.
All reactions