Repository navigation
[Bug] Choosing VS Code for a delivered file opens a Windows-side window instead of reusing the existing Remote-WSL window #9053
sui-zhiyuan
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
1. Summary
On a delivered-file card in the dsh Web UI, choosing VS Code from the card's application menu
launches the file through a Windows-side Shell association handler, so it appears in a new Windows
window (pointing at
\\wsl.localhost\...) instead of in the Remote-WSL window that already has theproject open.
2. Environment (complete)
10.0.26200(code --statusreportsWindows_NT x64 10.0.26200)6.18.33.2-microsoft-standard-WSL2, distro Ubuntu 26.04.1 LTS,WSL_DISTRO_NAME=Ubuntudsh --version); Node v26.8.1, pnpm 12.9.1; profileweb; Web UI athttp://127.0.0.1:308007f806f999227108933c2e30515b26eecc1fda74, x64, installed on the Windows sidems-vscode-remote.remote-wsl0.104.3 (Windows side)@deepseek-ai/dsh-api-session-controller@0.2.0-rc.2,@deepseek-ai/dsh-native-command@0.2.0-rc.2,@deepseek-ai/dsh-client-ui-deliverables@0.2.0-rc.2,@deepseek-ai/dsh-client-ui-open-in-app@0.2.0-rc.2,@deepseek-ai/dsh-host-open-in-app@0.2.0-rc.2Process Argvis--folder-uri=vscode-remote://wsl+Ubuntu/home/<user>/<project> --remote=wsl+Ubuntu(visible incode --status).tsis not VS Code, so the reproduction below necessarily travels the explicit-application=handler branch, not the default association3. Steps to reproduce
Preconditions:
cwdat the project root;present(a.tsfile here).Steps:
focused.
4. Expected behaviour
The file opens in the already-open Remote-WSL window — equivalent to running
code <absolute file path>inside WSL, which the wrapper chain expands to--file-uri=vscode-remote://wsl+Ubuntu/<path> --remote=wsl+Ubuntuand therefore reuses that window.5. Actual behaviour
Windows Shell starts VS Code — a new/local window on a path like
\\wsl.localhost\Ubuntu\...— and the Remote-WSL window is not reused.6. Preliminary analysis and evidence
Preliminary: this is derived from the installed package sources plus the observed request and
behaviour; no host-side logging was instrumented.
Equivalent direct reproduction: the request the menu selection sends, and the entry point traced
below.
Call chain (each hop verified in the installed packages):
deliverables.file.actions(dsh-client-ui-deliverables/lib/client.js:1702),filled on the client by
FileRouteAction— the control whose menu carries the VS Code entry(
dsh-client-ui-open-in-app/lib/client.js:884).POST /api/present.open(dsh-client-ui-deliverables/lib/index.js:48-76) →openVerified(
:128-143) →ctx.sessionController.openWorkspacePath(...).SessionController.openWorkspacePath: withapplication !== undefinedit callsopenFileApplication(dsh-api-session-controller/lib/index.js:3031-3040) →dsh-native-command'sopenNativeFileApplication.desktopTarget()re-classifies the platform aswin32becausenativeFileManager() === "explorer", and resolves the Windows path viawslpath -w(
dsh-native-command/lib/index.js:910-928).windowsFileApplications()embeds the path and the application as base64 into a temporary scriptand runs
powershell.exe -NoProfile -NonInteractive -STA -ExecutionPolicy Bypass -File <tmp>/associations.ps1(
:676-705).[DshFileAssociations]::Open($path, $application)(C# sourceconstant
WINDOWS_ASSOCIATIONS,:438-666):SHAssocEnumHandlersfinds the matching handler,then
SHCreateItemFromParsingName(path)→BindToHandler(BHID_DataObject)→IHandler::Invoke(IDataObject)(:648-671).--remote=wsl+<distro>and no--file-uri=vscode-remote://…is ever involved, so entering theexisting Remote-WSL window is structurally impossible.
Local measurement supporting the expected behaviour:
code <file>inside WSL expands to--file-uri=vscode-remote://wsl+Ubuntu/… --remote=wsl+Ubuntuand reuses the existing window (windowcount unchanged).
All reactions