You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Prevent DTD from cluttering the VS Code Ports section with previously forwarded ports #5403
Is your feature request related to a problem? Please describe.
The DTD process listens on a random port when it starts. VS Code automatically forwards this port and lists it in the Ports section of the IDE. Each time VS Code is closed and reopened, a new DTD process starts, and a new port is forwarded. Over time, this leads to an accumulation of previously forwarded ports, making it difficult to identify the ports of interest.
Describe the solution you'd like
It is possible to specify the port that DTD listens to. The solution would be to allow the Dart VS Code extension to configure this port in settings.json. This way, DTD will always listen on the same port, preventing clutter in the Ports section.
Describe alternatives you've considered
I searched the existing options exposed by this VS Code extension for "DTD," "daemon," and "port" but couldn't find an option that allows passing additional parameters to the command that starts DTD.
You'll need to restart/reload when you change this (you'll ofc also need a future release of the extension that includes the change).
It feels like a bug that VS Code is building up the ports even after the processes terminate (unless they're not terminating, in which case it's a bug of ours - please let me know if you're able to confirm if that's the case).
It feels like a bug that VS Code is building up the ports even after the processes terminate
AFAIK VS Code does not remove automatically ports once they have been forwarded. Note that VS Code users can preemptively forward ports even if no processes are currently listening to them.
Note that VS Code users can preemptively forward ports even if no processes are currently listening to them.
Ah, I see - I thought it was only valid to be forwarded when there was a process. In that case, the behaviour seems less weird. This fix should help then :-)
(btw, this change is in the current pre-release version of the extension if you want to try it out before it ships in the stable version)
Activity
DanTup commentedon Feb 5, 2025
Thanks for the info, this is now supported:
You'll need to restart/reload when you change this (you'll ofc also need a future release of the extension that includes the change).
It feels like a bug that VS Code is building up the ports even after the processes terminate (unless they're not terminating, in which case it's a bug of ours - please let me know if you're able to confirm if that's the case).
Thanks!
tschaffter commentedon Feb 10, 2025
Thanks for the update, @DanTup !
AFAIK VS Code does not remove automatically ports once they have been forwarded. Note that VS Code users can preemptively forward ports even if no processes are currently listening to them.
DanTup commentedon Feb 10, 2025
Ah, I see - I thought it was only valid to be forwarded when there was a process. In that case, the behaviour seems less weird. This fix should help then :-)
(btw, this change is in the current pre-release version of the extension if you want to try it out before it ships in the stable version)