cjbassi/ytop

[feature req] autoselect the process that consumes the most resources

Opened this issue · 4 comments

Please include a feature which would autoselect the process that consumes the most resources every tick.

It's extremely undesirable to have the whole list jump around (the process selected isn't consistent after all...), I want to see the top consumers at any given time.

Yeah I've noticed this too. I'm thinking the best way to do this is that if the cursor is moved to the topmost process, it should stay at the top instead of jumping around until the user moves the cursor onto a different process. Or maybe it just shouldn't ever jump around? I originally had it this way to prevent people from accidentally killing the wrong process, however once we add a confirmation dialog for killing the process then this shouldn't be an issue anymore.

Or we could add a key bind that lets you toggle between either following the selected process around, or keeping the cursor in the current position like you are requesting.

htop handles this pretty well, though I cant figure out what exactly it does. One option would be to temporarily stop sorting the list when the user moves the selection and resume sorting after some timeout.

A "follow process" toggle would make a lot of sense regardless

One option would be to temporarily stop sorting the list when the user moves the selection and resume sorting after some timeout.

This seems to be exactly what they doing with timeout something like 5-10 sec