Windows: integrated terminal triggers wsl.exe --update prompt on every command when WSL is not installed

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

On Windows machines where WSL is not installed, every command run in Cursor’s integrated terminal opens a console window. The window asks to install or update the Windows Subsystem for Linux (“Press any key to install…”) and times out after 60 seconds.

The window is triggered by Cursor’s localhost-port probe, which runs wsl.exe --list --running --quiet without first checking that WSL exists. When the WSL component is missing, wsl.exe is only the stub shipped with Windows. Instead of returning an empty list, the stub starts wsl.exe --update --confirm --prompt-before-exit, and that process shows the prompt.

On managed machines this is a real blocker: users have no admin rights, WSL is forbidden by IT policy, and the update cannot succeed anyway.

Root cause (from the shipped bundles)

  • out/vs/workbench/workbench.glass.main.js: OpenInBrowserWatcher.registerCommandDetection calls openBrowserUrlsService.captureLocalListeningPorts() on prompt start and on every onCommandFinished.
  • That call goes to the main process, out/main.js, NativeHostMainService.captureLocalListeningPorts. On Windows it runs netstat.exe -ano together with captureRunningWslListeningPorts() : eh(“wsl.exe”, [“–list”,“–running”,“–quiet”], { encoding:“utf16le”, timeout:…, windowsHide:true }, …)
    windowsHide does not help here, because the visible window belongs to the child process that the stub starts itself (wsl.exe --update …).
  • A second path calls probeService.captureLocalListeningPorts() directly, without checking the autoOpenLocalhostUrls setting. It runs when a localhost page loads in the Browser Tab, so it can trigger the same prompt.

Steps to Reproduce

  1. Use Windows 11 without the WSL feature installed.
  2. Keep the default for Cursor Settings → Browser → “Automatically open localhost links in the Browser Tab”, which is on.
  3. Open the integrated terminal and run any command, for example dir.
  4. A WSL install/update console window appears. It opens again at the start and end of every command.

Expected Behavior

No wsl.exe process is started when WSL is not installed. The WSL port lookup should be skipped quietly.

Operating System

Windows 10/11

Version Information

Cursor 3.24.18 (VS Code 1.128.0), commit be4c9e5350d77747b42cd467cbd3370a753d4640, build 2026-10-13

Additional Information

Suggested fix

Before starting wsl.exe, check that WSL is actually installed, and skip captureRunningWslListeningPorts() if it is not. Possible checks, which can be combined:

  • the registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss exists and has at least one distribution;
  • the WSL package is present (%ProgramFiles%\WSL\wsl.exe) instead of only the System32 stub.
    The result can be cached for the whole session, so the probe doesn’t run on every command.

Workaround

Turn off Cursor Settings → Browser → “Automatically open localhost links in the Browser Tab”. The terminal watcher then stops calling the probe. The Browser Tab path described above can still trigger it.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @Filou,

You traced this correctly!

On Windows, Cursor takes a snapshot of listening local ports at the start and end of each terminal command so it can open newly started dev servers in the Browser Tab.

Part of that snapshot asks WSL for its running distributions, and it does this without first checking that WSL is installed. On a machine without WSL, the built-in wsl.exe stub responds by starting its install/update flow, which is the window you see. This looks like the same issue as this earlier thread. I’ve flagged it to the team.

In the meantime, turning off Cursor Settings → Browser → “Automatically open localhost links in the Browser Tab” stops the prompt after terminal commands, in both the editor and the Agents Window. As you found, it doesn’t cover the Agents Window’s Browser Tab: loading a localhost page there can still trigger one prompt per page load.

Until a fix ships, opening your local dev pages in your regular browser instead of the Agents Window’s Browser Tab avoids that last case.