Windows (no WSL): extension triggers WSL install prompt at every VSCode startup via wsl.exe wslpath call

Open 💬 0 comments Opened Jul 12, 2026 by fuserdotcom

Environment

  • OS: Windows 11 Pro 10.0.26200 (native, WSL not installed — intentionally, Hyper-V conflicts with VirtualBox)
  • VSCode extension: anthropic.claude-code 2.1.207 (win32-x64)
  • Default terminal app: Windows Terminal

Bug

On every VSCode startup, a Windows Terminal window pops up running
C:\Windows\system32\wsl.exe --update --confirm --prompt-before-exit
showing "Press any key to install Windows Subsystem for Linux" (60s timeout).

Root cause

In extension.js, file:// URIs whose path looks POSIX-style are converted with:

execFileSync("wsl.exe", ["-e", "wslpath", "-w", t], {encoding:"utf8", stdio:["pipe","pipe","ignore"]})

The call is unconditional — there is no check that WSL is actually installed, and no setting gates it ("sandbox": {"enabled": false} in ~/.claude/settings.json does not help). On Windows without WSL, System32\wsl.exe is the in-box stub: any invocation relaunches as wsl --update --confirm --prompt-before-exit, i.e. the interactive installer window.

Confirmed by process tracing (parent chain from the extension host) and by the fix: locally patching that call site to return the path unchanged fully eliminates the popup.

Expected

Check WSL availability (e.g. wsl.exe --status exit code, or registry HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss) before shelling out to wslpath, or catch-and-skip when WSL is absent — never trigger the interactive installer from a background code path.

Repro

  1. Windows machine without WSL installed.
  2. Install the Claude Code extension; have a session/history containing POSIX-style file:// URIs.
  3. Start VSCode → WSL install prompt window appears.

View original on GitHub ↗