ponty / PyVirtualDisplay

Python wrapper for Xvfb, Xephyr and Xvnc
BSD 2-Clause "Simplified" License
697 stars 78 forks source link

Set new session on created display #80

Open dp-alvarez opened 1 year ago

dp-alvarez commented 1 year ago

The way PyVirtualDisplay works now, the virtual X server is created on the same process group as the Python script.

One of the effects of this is that when sending, for example, SIGINT to the Python script the virtual X server also receives it and exits before the script can do any cleanup.

Adding start_new_session=True to the subprocess.Popen in AbstractDisplay would easily solve this and possibly other subtle edge cases, as it makes a lot of sense for the X server to be on it's own session.