The machine I'm working from has many active X displays (one standard X server and many VNC displays). It is also running a handful of GUI applications, which appear on an X display.Assuming I have the PID (using ps) is there a method to determine which X screen the process is using, or even the value the DISPLAY variable held when launched?Even better if there's a method to show the value of DISPLAY for the process and all of its children process, in case some processes spawn their GUI as a child process.
Check which display an application is using
process;display;x server
If you have root access (or sudo ps) then you can display the environment of a process with the e option.  Inside here you should be able to see the DISPLAY variable (if it's set).  You probably need ww to ensure the output doesn't get truncated.e.g.% ps wwep $$ | tr ' ' '\012' | grep DISPLAYDISPLAY=:0So my current shell is talking to :0.Many OS's protect the environment from other users (because it may leak sensitive information), so a normal user can only see their own process environments.  root can see every user's.