-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Determine if process is running in the foreground #596
Comments
This is not possible with gopsutil currently (python psutil doesn't seem to support that either). If we implement a |
gopsutil uses only a first chars on This is because these status is very different on each platforms, like @Lomanic said. If you make a PR which can abstract these differences, we will merge it with many thanks. |
From my research:
I plan to implement this in the coming weeks if nobody does this in the mean time. |
Thank you for researching @Lomanic . I think adding a field to And, we can also define const instead of string.
|
I already implemented some |
Oh, you already implemented! Great! My idea was adding a new field to process struct and be return by using |
Indeed, the change you are suggesting (changing |
Ah, you are right. forget about my previous comment. Then,
That's a good idea! |
I added the API change to |
Fix #596 Implement process.Background and process.Foreground functions
Is there any way to determine if a process loaded with
process.NewProcess(<pid>)
is running in the foreground?I am looking for similar functionality to what
ps -O -p <pid>
returns in theSTAT
column; if there is a+
in that column then the process is running in the foreground.The text was updated successfully, but these errors were encountered: