Cursor automatically rewrites localhost URLs on WSL instead of opening the original port

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When using Cursor with a WSL2 workspace on Windows, ctrl-clicking a http://localhost: link such as http://localhost:4200 opens a different forwarded port like localhost:4201 or a random high port instead of opening the original URL.

This happens even though the service is already reachable from Windows at localhost:4200 via WSL’s built-in localhost loopback. It also happens even when auto port forwarding is disabled.

Steps to Reproduce

Open a WSL2 workspace in Cursor on Windows.
Start a dev server inside WSL on port 4200, for example next dev.
Verify in a Windows browser that typing http://localhost:3000 works.
In Cursor, ctrl-click the http://localhost:4201 link shown in terminal output or a file.

Expected Behavior

Cursor should open exactly http://localhost:4200 in the system browser without rewriting the port.

Since WSL2 already exposes Linux services on localhost, no port forwarding should be required.

Operating System

Windows 10/11

Version Information

Version: 3.0.12 (user setup)
VSCode Version: 1.105.1
Commit: a80ff7dfcaa45d7750f6e30be457261379c29b00
Date: 2026-04-04T00:13:18.452Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 39.8.1
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

Additional Information

This is the same bug report than Cursor rewrites localhost URLs on WSL instead of opening the original port

It started happening on latest cursor version.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, this is a known issue, we’re already tracking it from the original thread: Cursor rewrites localhost URLs on WSL instead of opening the original port.

Unfortunately, the workaround with remote.autoForwardPorts: false doesn’t help, other users have confirmed that too. For now the only option is to manually type the URL in your browser.

I’ve shared your report with the team, it helps with prioritization. There’s no ETA right now, but we’ll update the thread if we have any news.

A post was merged into an existing topic: Cursor rewrites localhost URLs on WSL instead of opening the original port