Where do disconnected processes go? Can I terminate them?

When closing the IDE, a box dialogue box asking Terminate/Disconnect/Cancel pops up, if a process is still running, whether that's a debugger or a regularly running process.

Let's say I have a process that won't terminate by itself eventually, maybe I forgot to include that option in my app or because of other reasons. When closing PyCharm and clicking disconnected, where do these processes go? Is there any way to access them?

The last time it happened to me, I used the taskkill command on Windows because I found the right one by sheer accident, but there has to be a way to find the process or its process ID, maybe even to attach it to a cmd window afterward, right?

3
4 comments

This happened to me today inadvertently after upgrading my IDE to a newer version. The background process then prevented me from starting up the same application again, because that port was still being used by the background process I had previously disconnected from.

The solution I used was to use the Activity Monitor (OSX) to show me all the running processes and identify the one I had inadvertently disconnected. In my case it was the only "java" process, and when I inspected it, I could see that is was using that same busy port that was preventing me from starting up the application again from within the IDE.

1

Is there a way to find the process id of the older disconnected processes? Of course, the underlying OS can be used to detect the same. However, having something similar in the IDE would provide a more integrated experience.

 

1

Hello there, the solution is ctrl + F2 as it stops all running programs on PyCharm.

 

0

I had this issue using Rider recently after detaching from a debugging session of an API project.

If you bring up the ‘Attach to Process’ dialog (under the Run menu), you'll be able to see the processes spawned by your IDE - the Tree View is helpful for this.

There isn't a way to terminate the process from within the IDE from what I can see. Attaching and stopping will just detach the debugger again once you're in this state.

To end the process, I used the PID provided by that Attach window to manually terminate the process within Windows:

taskkill /pid <process-id> /f

Rider continued to work normally after that.

0

Please sign in to leave a comment.