Open jwodder opened 2 weeks ago
Thats unfortunate-- ps -s
is the backbone of how this whole thing works :/
One possible option for working around this would be to give up on the idea of "no dependencies" (not sure why you're prioritizing that to begin with) and using https://github.com/giampaolo/psutil instead of ps
.
Without dependencies, the script is runnable even without "installing" by just executing the script directly. @yarikoptic suggested this would be helpful in tightly controlled HPC environments.
Surely such environments would still allow installation inside a virtualenv, though?
https://github.com/giampaolo/psutil looks interesting ... but that one also does not seems to have a concept for "session" (upon a quick search).
I wonder what would be the preferable way then to track the children processes using psutil
?
NB smells like we might need some pluggable/switchable setup to allow for different ways to track children processes if we decide to go cross-platform which in general would be great to have.
duct
invokesps
with the-s
option for filtering by session ID, but the version ofps
available on macOS by default (as of macOS Sonomoa 14.5 on an Intel chip) does not have this option (or, seemingly, any way to directly filter by session).