Exclude procs process when using sudo
Hi there, fyi, not sure if it's an issue or some mis-understanding / configuration by me;
The procs process itself is only excluded when not using sudo:
$ procs test123
PID:▲ User │ TTY CPU MEM CPU Time │ Command
│ [%] [%] │
$ sudo procs test123
PID:▲ User │ TTY CPU MEM CPU Time │ Command
│ [%] [%] │
4372 root │ s004 0.0 0.0 00:00:00 │ sudo procs test123
Best, David.
-- procs 0.14.4 (installed via HomeBrew) macOS 14.3.1
This is expected behaviour.
The 4372 is sudo process, and the sudo process will launch procs.
show_self = false option hides the self procs process only, so sudo process will be shown.
If show_self = false are given, the result of sudo procs will be like below:
$ sudo procs test123
PID:▲ User │ TTY CPU MEM CPU Time │ Command
│ [%] [%] │
4372 root │ s004 0.0 0.0 00:00:00 │ sudo procs test123
4373 root │ s004 0.0 0.0 00:00:00 │ procs test123
Thank you for explaining @dalance
Would you please consider to implement a feature to add a show_self_sudo = false setting?
Because currently if i want to watch some process, for example the borg processes with sudo procs --watch --tree borg, then the result is cluttered with multiple lines containing the entire tree of the sudo procs process (including the login shell, terminal program, etc.).
All of this is not relevant, and it makes it more difficult to read the result...
Thank you!
I'll add show_self_parents option at #607.
It suppress to show the parents processes which have self as the only child.
For example, in the following process tree, "bash - sudo - procs" will be hidden. The root "bash" will be shown because it has other process which are not related to procs as the children.
- bash
- bash
- sudo
- procs
- sudo
- vim
- ssh
- bash
How about it?
@dalance That would be the perfect solution i think.
I've released v0.14.5.
Tested, and it's working nicely now. Thank you for the quick fix!