No automatic port forwarding from terminals defined in background agent environment.json

Describe the Bug

Ports exposed by terminals defined in environment.json are not auto-forwarding. Manually adding a forwarded port does work. It seems that the vscode automatic port forwarding is probably just not aware of the terminals started in environment.json.

Steps to Reproduce

Add an entry to the environment.json “terminals” key that exposes a port. When you start a background agent, the port will not be automatically exposed.

Expected Behavior

I would expect the port to be forwarded automatically, similar to what happens in the background agent environment if I start the server in a GUI terminal.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.1.3 (Universal)
VSCode Version: 1.96.2
Commit: 979ba33804ac150108481c14e0b5cb970bda3260
Date: 2025-06-15T06:37:17.379Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue