dvorka / hstr

bash and zsh shell history suggest box - easily view, navigate, search and manage your command history.
http://me.mindforger.com
Apache License 2.0
4.04k stars 231 forks source link

Improve HSTR to read input from pipe #235

Open dvorka opened 6 years ago

dvorka commented 6 years ago

HSTR visualization and filtering might be used for use cases like

find -type f | hh

To provide functionality like fzy https://github.com/jhawthorn/fzy - simply load data from std input an then use existing history logic.

dvorka commented 4 years ago

Stdin input detection:

if (isatty(0)) {
    fprintf(stderr, "input was not redirected\n");
    exit(EXIT_FAILURE);
}

Persist input as temp file and redirect HSTR to that file as it would be history file.