We already know the $EDITOR, the $VISUAL, the $PAGER, and all of the usual UNIX commands.
It seems that the interactive filter fits well in this ecosystem of commands.
You can think of it as an interactive
grep. It takes lines from stdin, display them on screen, and prompt user for input to match against these lines, and filter only the lines that matches. The user can select the input candidates somehow, and while selection is made, the result is sent to stdout, to be exploited by the next command.
This is a feature that has often been integrated to softwares, such as a web browser for the URL bar, start menus to find applications, and even web pages such as search engines…
It seems that there are also a lot available for the terminal as well. I am presenting those that I know, in the order they come to my mind.
I will try to update this list according to the comments.Fuzzy matching
They match any string with the character of the input in the same order. Just like if we put a wildchar between every character of the input.
This often comes with re-ordering the lines to put the shortest one at the top of the list.fzf - Go
head -n 10000 /dev/urandom | fzfperfect! Just like plain lines!
Many features, pretty popular. Still not perfect for me, I like tools written in C for command line interactions, and I do not want something that big. It is not bloated, just bigger than what I want.fzy - C
head -n 10000 /dev/urandom | fzynot bad, did not segfault.
Strangely looking similar to fzf, maybe the two projects are related. This version is much smaller.
Simple tool that does fuzzy filtering efficiently.pick - C
Simple and works well.tmenu - C
Simple tool that works well, with a great effort on making it reliable (only C99 source code) with no dependency. It still supports line editing, with emacs-like keybindings.pmenu - python
With a ranking algorithm.icepick - rust
Re-write of selecta in rust for performance.heatseeker - rust
Re-write of selecta in rust for performance.gpicker - C
Simple, in haskell, oriented to pick files.Plain string matching
The input string is filtered as is.percol - python
Made after percol, re-write in Go to make in faster and do not require python.tpick - C
Using ncurses, but very small, about 300 linesPathPicker - Python
Input is splitted at every space, and each word is matched independently like in a search engine.slmenu - C
For single-line menu: really an equivalent of dmenu for the command line:
A more maintained version is present in the vis repo: vis-menu.selector - C
Supports regexp, and ‘;’ as separator for wordsiomenu - C
The one I made, so that I could has these two things:
It is not better than the others, it just has a different approach.Specific
Those that are not exactly filters, but that are still convenient and useful.smenu - C
Horizontal selection dialogues using arrow keys for selection.