'Popen Detached Process is Closing When Parent Closes

Edit: I think this is an issue with vscode, as when run from Sublime Text or Powershell the started process does indeed remain running.

I have written a Python library that includes a function to launch an independent process. This is essentially the call (the partial is called in the surrounding function)

return partial(
        Popen,
        args=args,
        creationflags=DETACHED_PROCESS | CREATE_NEW_PROCESS_GROUP,
        close_fds=True
    )

The launching all works well, but when the process that launched the detached process exits, then the launched process quits.

How do I launch a process that does not exit when it's parent process exits?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source