htop-dev / htop

htop - an interactive process viewer
https://htop.dev/
GNU General Public License v2.0
6.57k stars 440 forks source link

Filter on process state #1544

Open OlafvdSpek opened 2 months ago

OlafvdSpek commented 2 months ago

Is it possible to filter on process state (state == 'D' for example)? If not, it'd be nice. And is there a meter that'll show the number of processes in each state?

BenBE commented 1 month ago

The answer to both of your questions is currently: No.

This feature does not currently exist and the necessary information to make it a meter is not currently counted while gathering information.

HankB commented 1 month ago

This looks like something I can take a look at for hacktoberfest. I'll fork, clone and build (to get started) unless someone objects.

Pointers to "the necessary information" and how to add to what is counted would probably get me off the ground a little quicker.

Thanks!

Step 0: look for contributor guidelines.

BenBE commented 1 month ago

Step 0: Read this document

Step 0.5: https://github.com/htop-dev/htop/blob/9c316cc14cafce1097583247710b6d74c1feb505/Process.h#L38-L56 and https://github.com/htop-dev/htop/blob/9c316cc14cafce1097583247710b6d74c1feb505/Process.h#L192

HankB commented 1 month ago

I have not had the time to get to this so I won't be able to complete this work.