Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Add support for filtering processes by substring. #147

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

rephorm
Copy link

@rephorm rephorm commented Jun 1, 2019

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.

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.
@rephorm rephorm changed the title Add support for filtering process by substring. Add support for filtering processes by substring. Jun 1, 2019
@cjbassi
Copy link
Owner

cjbassi commented Jun 3, 2019

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

So a few things I think we should do:

  • rerender the process list after every keypress, since it currently only rerenders on the next tick
  • make <Esc> cancel the filtering
  • maybe we shouldn't consume the <Tab> keypress, so users can still toggle process grouping when filtering
  • add a cursor to the filter prompt
  • if no processes are displayed, the scroll indicator should display '0 - 0 of 0' (sometimes it gets a little buggy)

README.md Outdated Show resolved Hide resolved
Brian Mattern added 7 commits June 3, 2019 14:08
Only swallow events that are explicitly handled by the editor. Fall
through to the default event handling for all other events.

Also, cancel editing on <Escape> and fix README file formatting.
Also, change from [Filter: ...] to Filter: [...].
@rephorm
Copy link
Author

rephorm commented Jun 3, 2019

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
Copy link
Owner

cjbassi commented Jun 6, 2019

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
Copy link
Author

rephorm commented Jun 6, 2019

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
Copy link
Author

rephorm commented Jun 13, 2019

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
Copy link
Author

rephorm commented Jul 11, 2019

Ping

@cjbassi
Copy link
Owner

cjbassi commented Jul 15, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants