Live data from Hacker News

Show HN: History suggest box for your shell

github.com

1–10 of 29 posts

Re: Show HN: History suggest box for your shell

#2
hstr-rs is a shell history suggest box that provides quick access to the commands in your shell history. Just search for the command you want to execute (regex mode is supported), or, if you don't precisely know what you're looking for, you can browse through the commands until you find the one you want to execute. Apart from this, you can delete unwanted entries from your history, too, and more. It should work on all terminals ranging from linux term to xterm. It was initially made for bash but it should work as well with zsh, ksh, and tcsh, too.

I use it on a daily basis.

Check out the README for instructions if you want to try it out.

Suggestions, bug reports, etc. are welcome.

Let me know what you think:

https://github.com/adder46/hstr-rs

Re: Show HN: History suggest box for your shell

#4
post #2

hstr-rs is a shell history suggest box that provides quick access to the commands in your shell history. Just search for the command you want to execute (regex mode is supported), or, if you don't precisely know what you're looking for, you can browse through the commands until you find the one you want to execute. Apart from this, you can delete unwanted entries from your history, too, and more. It should work on al…

Small mistake in the readme

> hstr is shell history suggest box. Like hstr, but with pages.

Should be "hstr-rs is shell..." I presume?

Looks like a nice project :) I'll give it a go. I've often wanted to iterate through options when ctrl-r ing in bash (not saying there isn't a way to do that, but if there is I don't know it)

Re: Show HN: History suggest box for your shell

#6
This is pretty cool. I'm always mashing the up arrow, so I installed this in anticipation of making my life easier :)

I didn't have `cargo` or any other rust language support installed. However, that seems pretty straight forward: https://www.rust-lang.org/tools/install

You may want to throw that into the README.

Anyhow, I'm running this on WSL2/Ubuntu 20.04 using zsh + ohmyzsh. It installs cleanly, and I just added `alias hh=hstr-rs` to ~/.zshrc as the only additional step. Works nicely!

Re: Show HN: History suggest box for your shell

#8

This is pretty cool. I'm always mashing the up arrow, so I installed this in anticipation of making my life easier :) I didn't have `cargo` or any other rust language support installed. However, that seems pretty straight forward: https://www.rust-lang.org/tools/install You may want to throw that into the README. Anyhow, I'm running this on WSL2/Ubuntu 20.04 using zsh + ohmyzsh. It installs cleanly, and I just added…

If you want to keep your zshrc "clean" you can add any number of individual scripts to `~/.oh-my-zsh/custom` and they will be executed for every new shell.

Re: Show HN: History suggest box for your shell

#9
post #7

This looks cool! I personally use fzf [0] for a similar functionality. It brings fuzzy-search to a lot of aspects of the shell, like reverse search but also autocompletion of `kill` for example. [0]: https://github.com/junegunn/fzf

I was about to comment that this kinda looks like fzf + ncurses.

Re: Show HN: History suggest box for your shell

#10
Good idea and fairly easy to implement from .bash_history. I never thought of it myself so I must be content with reverse search and grepping through bash history.

One suggestion would be to make it a homebrew recipe for macOS and the Linux version. It would then see a lot more adoption (even if the alias has to be set manually which is fine as it's personal). I'd install it instantly (and probably forget about it for a month).

Post reply on HN