When using Cursor with a WSL2 workspace on Windows, ctrl-clicking a http://localhost: link such as http://localhost:3000 opens a different forwarded port like localhost:3001 or a random high port instead of opening the original URL.
This happens even though the service is already reachable from Windows at localhost:3000 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 3000, for example next dev.
Verify in a Windows browser that typing http://localhost:3000 works.
In Cursor, ctrl-click the http://localhost:3000 link shown in terminal output or a file.
Expected Behavior
Cursor should open exactly http://localhost:3000 in the system browser without rewriting the port.
Since WSL2 already exposes Linux services on localhost, no port forwarding should be required.
On WSL2, Linux services bound to port 3000 are already reachable at Windows localhost:3000. The Windows kernel reserves this port for WSL loopback, so Windows applications cannot bind it.
Cursor still attempts to forward the port and rewrites the URL, which is unnecessary and leads to confusion and broken expectations. Manually opening localhost:3000 in the browser works correctly. Only Cursor’s link handling causes the issue.
This appears to be a forwarding policy problem specific to WSL, not a networking limitation.
The screenshot confirms the issue: port 3000 is being forwarded to localhost:49773 instead of staying on :3000. This shouldn’t happen on WSL2, since ports are already available via localhost.
Workaround:
In the Ports panel, remove all those forwards (right-click > Stop Forwarding)
Add this to your settings.json:
"remote.autoForwardPorts": false
Restart Cursor
This should stop automatic port forwarding. If after this Ctrl-click still opens the wrong port, let me know. That would confirm a bug we need to escalate.
Have noticed this issue since at least November 2025. Getting a bit arduous to type localhost:3000 every time.
Has caused major headache related to auth bug false flags due to mismatch between NEXT_AUTH_URL pointing to localhost:3000 to when server is running on localhost:3000.
Should be a straightforward fix. Can you escalate to engineering team? Thanks!
Hey, the bug is still on our radar. I see that the remote.autoForwardPorts: false + portsAttributes config isn’t helping, which is expected because the issue isn’t auto-forwarding. It’s about how Cursor rewrites the URL on Ctrl-click.
I’ve escalated this to the team. I can’t promise any specific timelines.
Can you also share the Cursor version you’re on right now? It’ll help for the report.
Its an issue on the most recent update that I installed on 03/03/26. I cannot find the version number. However like I said I have noticed this issue since at least November 2025 so its a recurring issue across many versions.