[BUG] Drag & drop from the VS Code Explorer silently does nothing in Remote-WSL/SSH/Dev Containers — drop handler only accepts `file://` URIs
Summary
Shift+dragging a file from the VS Code Explorer into the Claude Code panel does nothing when the window is connected to a remote (Remote-WSL, Remote-SSH, Dev Containers). No @mention is inserted, no attachment appears, no error is shown. The same drag works in a local window.
The cause is in the webview's drop handler: it accepts only file:// URIs, but remote windows produce vscode-remote:// URIs.
Environment
- Extension:
Anthropic.claude-code2.1.261 (installed remote-side,~/.vscode-server/extensions/anthropic.claude-code-2.1.261-linux-x64) - VS Code: 1.136.1 (commit
a44adf7f53e00964ab890f9f8758a334f1fc15bc) - Client: Windows 11
- Remote: WSL2 (Ubuntu), kernel 6.18.40.1-microsoft-standard-WSL2
- Also present in 2.1.259 (verified), so not a recent regression
Reproduction
- Open a folder in a Remote-WSL window (Remote-SSH and Dev Containers should behave identically).
- Open the Claude Code panel.
- Shift+drag any file from the VS Code Explorer onto the input.
- The drop overlay appears, but on release nothing is inserted.
Expected: an @path/to/file mention is inserted, as happens in a local window.
Root cause
In webview/index.js, the drop handler reads VS Code's internal drag formats (resourceurls, codeeditors) and passes each URI through this helper (eG0 in 2.1.261, OJ0 in 2.1.259 — minified names change per release):
async function eG0($, J) {
if (!$.trim()) return null;
let Z = $.trim();
if (!Z.startsWith("file://")) return null; // <-- here
if (Z = decodeURIComponent(Z.substring(7)), J && Z.startsWith(J)) {
if (Z = Z.slice(J.length), Z.startsWith("/")) Z = Z.slice(1);
}
return Z;
}
In a local window the Explorer hands over file:///c%3A/Users/..., which passes. In a remote window the same file is vscode-remote://wsl%2BUbuntu/home/user/project/src/app.ts, so the guard returns null and the drop is discarded silently.
The codeeditors branch has the same problem for a different reason — it reads:
let U = q.resource.external || q.resource.fsPath;
external is the vscode-remote://… string, so it also fails the file:// check. Preferring fsPath (/home/user/project/src/app.ts) would have worked here.
Note the drag detection is scheme-agnostic, which is why the overlay still appears and the failure looks like a no-op:
function E15($) {
return Boolean($?.includes("Files") || $?.includes("resourceurls") || $?.includes("codeeditors"));
}
Suggested fix
Normalize vscode-remote://<authority>/<path> to its path before the existing logic. Patching locally with this made drag & drop behave exactly as it does on a local window:
if (Z.startsWith("vscode-remote://")) {
let i = Z.indexOf("/", "vscode-remote://".length); // first "/" past the scheme = start of path
if (i < 0) return null;
Z = "file://" + Z.substring(i);
}
Verified against the patched build (cwd /home/user/project):
| input | output |
| --- | --- |
| vscode-remote://wsl%2BUbuntu/home/user/project/src/app.ts | src/app.ts |
| vscode-remote://wsl%2BUbuntu/home/user/notes.md (outside workspace) | /home/user/notes.md |
| file:///home/user/project/README.md | README.md (unchanged) |
| vscode-remote://badauthority | null |
| https://example.com/x | null |
Making the codeeditors branch prefer resource.fsPath over resource.external would fix that path too.
Workarounds
- Type
@and pick the file — resolved remote-side, unaffected. - Drag from Windows Explorer instead of VS Code's Explorer — that is an OS-level drag, so it takes the
dataTransfer.filesbranch and works. - Right-click → Copy Relative Path, paste as text.
Related
- #21044 — same bug on Remote-SSH (Cursor), closed as not planned; it guessed at
vscode-remote://but had no code-level confirmation. This report has one. - #25128 — drag & drop failing in the VS Code panel on macOS; may or may not be the same root cause.
4 Comments
+1 just ran into the very same problem using the dev-container extension and I can reproduce this issue using the wsl extension as well.
Thanks for confirming! Good to know Dev Containers hits the exact same
vscode-remote://URI issue.+1, same issue here.
Confirms the same behavior described above: Shift+drag from the Explorer shows the
drop overlay but nothing gets attached. The
vscode-remote://URI diagnosis matches —this affects Remote-SSH sessions with a Linux server as well, not just WSL/Dev
Containers.
Thanks for confirming on Remote-SSH — that's now three remote transports (WSL, Dev Containers, Remote-SSH) all hitting the same
file://-only guard in the drop handler, which points pretty clearly at the sharedvscode-remote://URI handling rather than anything transport-specific.The suggested fix in the issue description still applies here: normalize
vscode-remote://<authority>/<path>tofile://<path>before the existingstartsWith("file://")check, e.g.That handles WSL, Dev Containers, and Remote-SSH uniformly since they all produce the same URI scheme. The
codeeditorsbranch would also needresource.fsPathpreferred overresource.externalfor the same reason.In the meantime, the workarounds in the description (typing
@to pick the file, or dragging from the OS file explorer instead of VS Code's Explorer) should unblock this on Remote-SSH too.