TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: History suggest box for your shell

67 点作者 adder46超过 4 年前

8 条评论

wh33zle超过 4 年前
This looks cool!<p>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.<p>[0]: <a href="https:&#x2F;&#x2F;github.com&#x2F;junegunn&#x2F;fzf" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;junegunn&#x2F;fzf</a>
评论 #25557559 未加载
评论 #25557731 未加载
评论 #25555685 未加载
SmellTheGlove超过 4 年前
This is pretty cool. I&#x27;m always mashing the up arrow, so I installed this in anticipation of making my life easier :)<p>I didn&#x27;t have `cargo` or any other rust language support installed. However, that seems pretty straight forward: <a href="https:&#x2F;&#x2F;www.rust-lang.org&#x2F;tools&#x2F;install" rel="nofollow">https:&#x2F;&#x2F;www.rust-lang.org&#x2F;tools&#x2F;install</a><p>You may want to throw that into the README.<p>Anyhow, I&#x27;m running this on WSL2&#x2F;Ubuntu 20.04 using zsh + ohmyzsh. It installs cleanly, and I just added `alias hh=hstr-rs` to ~&#x2F;.zshrc as the only additional step. Works nicely!
评论 #25555610 未加载
adder46超过 4 年前
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&#x27;t precisely know what you&#x27;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.<p>I use it on a daily basis.<p>Check out the README for instructions if you want to try it out.<p>Suggestions, bug reports, etc. are welcome.<p>Let me know what you think:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;adder46&#x2F;hstr-rs" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;adder46&#x2F;hstr-rs</a>
评论 #25555326 未加载
评论 #25555872 未加载
personjerry超过 4 年前
In case you didn&#x27;t know, bash has a basic version of this already embedded. You can search your bash history from the command line with Control+R (not Cmd+R even for Macs).
评论 #25556968 未加载
评论 #25562699 未加载
keyle超过 4 年前
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.<p>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&#x27;s personal). I&#x27;d install it instantly (and probably forget about it for a month).
turtleofdeath超过 4 年前
How is this different than reverse-i-search?
评论 #25555428 未加载
评论 #25556173 未加载
angrais超过 4 年前
How does this differ from peco [1]?<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;peco&#x2F;peco" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;peco&#x2F;peco</a>
villgax超过 4 年前
ctrl-r &amp; fuck have been more than enough for me most of the time