-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Random ports appear when exiting debug mode #1092
Comments
@connor4312 It looks like this is what's happening:
Would you consider continuing to return |
I'm not sure what I want to do here. When you detach from the process but leave it running, js-debug no longer knows about the lifecycle of the process and cannot authoritatively return whether a port is a "debug port". What triggers the editor to check for port attributes again? VS Code knows the process ID is unchanged, is it expected that port attributes might change for existing The simplest solution would be for js-debug to keep a small cache of known pairs itself since we know that debug ports will never become not-debug-ports for any given process, but this is something that I think the editor could also assume. |
Hmm, I assumed since JS Debug contributed the terminal profile it would consider all terminals created with that profile to belong to JS Debug in a way, but it sounds like this isn't how terminal profiles work. VS Code checks for port numbers every couple seconds on a timer and we check for attributes any time there's a change there. We could do the |
This is what happens, but given an incoming port/pid we don't know whether that belongs to one of our terminals. We only check to see if we know it because of a debug session, which isn't the case if the user detaches the debugger but leaves the program running. I'll add a pid/port cache in js-debug to mitigate this. |
Thank you! |
Describe the bug
When exiting a JavaScript Debug session from the debug bar, 1 port turns into 3 with two being seemingly random ports.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The debugger is disconnected, but all other UI remains the same.
What happens instead
The debugger is disconnected, but two seemingly random ports are added in the "Ports" view. These go away when the actual terminal process that started the debugger is killed.
VS Code Version: 1.59.1
Additional context

The text was updated successfully, but these errors were encountered: