I use it all the time to select a command from my shell history. It is a very convenient addition to zsh-autosuggestions (one of those things that you use hundreds times per day without even thinking about it).
Late to the party. This screams like it needs to be part of the shell instead of an addition.
E. G. I type a command in the shell, end it with pipe, and press enter, it doesn't delete the command but runs a preview of the output top 10 lines? This way I can continue to the edit the command without losing the context, the pipe, or I can decide to redirect it to a file!
Hmm, interesting thought! The tool needs to do some ugly buffering however; would there be place for it in a shell? Also, I suppose some kind of "Ctrl-Enter" or something would be a better idea instead? So that it could also be hit at any point in the line... But how about scrolling through the preview?
The most frequent use case for this for me would be interactive grep. The "fzf" tools has this along with fuzzy search. And the text doesn't disappear while you type "grep" like it does with "up".
I will definitely try this out too though when I make a pipeline with sed, cut, etc.
Comments (217) 34 threads
Earlier commentsI use it all the time to select a command from my shell history. It is a very convenient addition to zsh-autosuggestions (one of those things that you use hundreds times per day without even thinking about it).
E. G. I type a command in the shell, end it with pipe, and press enter, it doesn't delete the command but runs a preview of the output top 10 lines? This way I can continue to the edit the command without losing the context, the pipe, or I can decide to redirect it to a file!
For something a lot dumber: here's a tiny thing to print out pipe contents to allow for cancelation before continuing the pipe.
https://gist.github.com/jasisk/be34ae93b74a3d3e8f0a4daac1237...
I will definitely try this out too though when I make a pipeline with sed, cut, etc.
All comments shown.
Couldn't load more comments. Check your connection and try again.