Add options to display parents and children processes of filtered pro…
This PR based on @ashamza 's work https://github.com/hishamhm/htop/pull/973#issue-356794743 https://github.com/htop-dev/htop/issues/76#issuecomment-749169626
// co-authors added in commits seem doesn't link to github users
The only thing I did was update the patch to fit the current version code.
Exactly what I wanted. Works good for me.
Very nice work @yurenchen000. This should have a key binding to be quickly toggled as well. May be Shift-F4 + Ctrl-F4? (Marked the typo Childern, please fix)
got it, I'll fix typo right now.
but I'm not sure if I can add keybinding for it
I think those options should probably be exclusive: Either show parents or children, but showing both does not make any sense with filtering.
I think it has practical uses, imagine this scenario:
- filter by
bash- view It's parents (ancestors): who opened it, a ssh or tmux
- view It's children (descendants): what's it doing, run vim or some service
// equivalent to viewing its family tree
I was assuming this refered to the whole tree, not just the next level in each direction. In that case having both makes sense.
Also, do these options make sense in flat view or are they intended for tree mode only?
I was assuming this refered to the whole tree, not just the next level in each direction. In that case having both makes sense.
@BenBE agree, use whole tree is my primary usage, if matched item can highlight it'll perfect
Also, do these options make sense in flat view or are they intended for tree mode only?
@tanriol yes, The current implementation can filter normally in non-tree view, But I also think it doesn't make much sense in non-tree view.
Did you mean that limit this functionality to tree view mode, And figure out a way to reuse the process tree information from the tree view?
Also, do these options make sense in flat view or are they intended for tree mode only?
Depending on the task it can make sense to have this available outside tree view too.
anyone working on this ?
for now I am achieving similar with:
process_name=tmux;
watch -n 1 -d "pgrep $process_name | xargs -I {} pstree -p {}"