hstr icon indicating copy to clipboard operation
hstr copied to clipboard

Improve HSTR to read input from pipe

Open dvorka opened this issue 8 years ago • 0 comments

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 avatar Oct 19 '17 11:10 dvorka

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.

dvorka avatar Dec 11 '19 22:12 dvorka