hstr
hstr copied to clipboard
Improve HSTR to read input from pipe
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.
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.