

Percol: An interactive grep tool in your terminal - bigsassy
https://github.com/mooz/percol

======
0x0
zsh already has a built in menu selection system that looks a lot like the
animated .gif here. Check out "zstyle ':completion:*' menu select"

~~~
rcthompson
I believe that is what is being shown. The tool is (I think) being
demonstrated in a zshell with that feature (and probabaly countless others)
turned on, so it is difficult to tell what is shell and what is percol. Or
maybe not. The point is I don't know.

------
jkarni
I worked on a similar project: a tool that (primarily) tees it's stdin to your
tty before you decide how to continue your pipe[1], which is a little more
general, though it's admittedly less polished or nice. I think there's an
interesting space in making the process of writing commands more interactive,
though doing that really well will involve an intelligent solution to the
problem of commands with side effects.

[1] [https://github.com/jkarni/extendp](https://github.com/jkarni/extendp)

------
jabagawee
Reminds me of Gary Bernhardt's selecta [1].

[1]
[https://github.com/garybernhardt/selecta](https://github.com/garybernhardt/selecta)

------
agumonkey
Let's rewrite all major userspace tools this way, or maybe use emacs ? I don't
know.

ps: not sarcastic at all.

~~~
kachnuv_ocasek
I agree with your second idea. I don't see how it's different from Vim or
Emacs.

~~~
brianpgordon
What I was impressed by is

    
    
      git checkout $(git branch | percol)
    

to select the branch name interactively from a menu. How would you do that in
Vim or Emacs?

~~~
0x0
Zsh completion with the menu style can do that, git checkout <tab> and you get
a browseable list of branch names.

~~~
agumonkey
or dmenu

~~~
dhamidi
Funnily enough, I recently implemented something akin to percol:

[https://github.com/dhamidi/tmenu](https://github.com/dhamidi/tmenu)

It actually tries to be dmenu for the terminal.

~~~
agumonkey
Glorious, I was about to start a similar thing (in python though). Time to
play with your toy.

ps: I'd add a readline/inputrc alias for '| tmenu '

~~~
dhamidi
Would you mind sharing what that alias would look like and do? I can only
imagine it appending the string "| tmenu" to the current line, eventually
pressing Return for the user as well.

~~~
agumonkey

        $ bind '"\C-L": "\| less -S \C-j"'
    

Warning: seems like GNU readline isn't case sensitive so C-L === C-l thus, in
this example, C-l default behavior (clear screen?) is overridden. I didn't
RTFM so trust yourself.

------
rawland
Actually I downloaded

[https://github.com/hchbaw/auto-fu.zsh](https://github.com/hchbaw/auto-fu.zsh)

after seeing this README.md.

------
kroeber
fzf [1] is another nice alternative to this.

[1] [https://github.com/junegunn/fzf](https://github.com/junegunn/fzf)

------
lnkmails
You made my day.

------
natch
The gif animation is ridiculously fast. Can't really see what's going on. If
it's not needed, you could just delete it.

~~~
rcthompson
The gif animation is confusing to me because the shell appears to be
extensively customized, so I can't tell what is percol and what is crazy
zshell customization.

~~~
vbit
Agree. There is already completion going on from the shell and it's very
distracting. The demo should use a dead simple shell.

