cjbassi / gotop

A terminal based graphical activity monitor inspired by gtop and vtop
GNU Affero General Public License v3.0
7.36k stars 436 forks source link

Add support for filtering processes by substring. #147

Open rephorm opened 5 years ago

rephorm commented 5 years ago

Press / to input a filter string. The proc list will be filtered to procs that contain the filter as a substring of either the command or the string representation of the PID.

cjbassi commented 5 years ago

Nice, this is something I've wanted for a while.

So a few things I think we should do:

rephorm commented 5 years ago

Great suggestions! Implemented.

I reworked the event handling to not swallow events other than those specifically handled. So, <C-u>, <C-d>, etc also work now while editing.

<Escape> doesn't seem to be sent immediately (presumably waiting for terminal escape codes?), so it feels laggy compared to <C-c>.

cjbassi commented 5 years ago

Wow, really nice. Quite a few changes so it'll take me a little while to go through.

Btw, <Escape> is working fine for me with the filtering.

rephorm commented 5 years ago

Take your time! I'll stop updating this branch. :) I added cursor movement (via <Left>, <Right>) in the scroll branch if you're interested.

rephorm commented 5 years ago

I should have clarified earlier that the 3rd commit undoes many of the changes in the first commit. It will probably be easier to review changes from all commits instead of individually reviewing. If you would like me to squash the related commits in a separate branch to simplify things, let me know.

rephorm commented 5 years ago

Ping

cjbassi commented 5 years ago

Sorry for the silence. This is looking really nice! Seems like all the previous suggestions were implemented. I looked over everything and it LGTM so feel free to add in anything else you've done. One thing is if you could sign #151 and license your additions under MIT that would be great since I'm in the process of relicensing.