HN2new | past | comments | ask | show | jobs | submit | ddworken's commentslogin

I actually made a CLI tool (https://github.com/ddworken/hishtory) that automatically binds to Control+R to support both history searching and AI queries (by prefixing queries with `?`).

Here's the prompt engineering I did: https://github.com/ddworken/hishtory/blob/master/shared/ai/a...


Ah this is a far more significant effort. I'm glad to see that there's so much consensus that default shell history is broken (I used to use logrotate because it would always truncate regardless of how many ways I told it to not ever, under no conditions, ever, do that).

Nice to see there's so many options these days. Someone else mentioned "https://atuin.sh/" in this thread - which is also new to me. Keeping up with things is seemingly impossible


Here's how I think I make sure it doesn't truncate:

  shopt -s histappend
  shopt -s cmdhist
  export HISTCONTROL=ignoreboth
  export HISTFILESIZE=-1
  export HISTFILE=~/.bash_eternal_history
  export HISTSIZE=-1
  export HISTTIMEFORMAT="%d/%m/%y %T "
  export HISTIGNORE="history:ls:l:ll:pwd:exit:clear"
It's almost a megabyte now... By when did it start to truncate for you?


somewhere around a few thousand lines. I want it to support tens of millions. I have a fast enough computer, storage is effectively free. I've tried all those things - everything short of doing a bunch of bpf filters and setting breakpoints on the binary myself.

honestly, with these modern systems this shouldn't be a problem any more. I look forward to it.


Yeah i have lots. Try my solution might work for you also.


I'll also plug my project [0] as another alternative that supports syncing (similar to Autumn) and also has a number of powerful customization features (e.g. custom columns to collect arbitrary metadata with each command, like the git remote) and an AI shell command generator.

[0]: https://github.com/ddworken/hishtory


If you're interested in something more actively maintained, and with cross-machine syncing, two recent alternatives are:

* github.com/ddworken/hishtory * github.com/ellie/atuin

Disclaimer: I'm the maintainer of the first one.


Ah, thank you commenting on this! This is absolutely unintentional and was the fault of a missing comment in the bash script (that I didn't notice because I generally use zsh). See https://github.com/ddworken/hishtory/commit/72ff95ab8b23c3be... and if you run `hishtory update` it should be all fixed.


Yup exactly! This way you'll never again lose a history entry.


Yes! Though they'll have a single shared history log since there is no way to distinguish between them.


See https://github.com/ddworken/hishtory/blob/master/backend/web...

Also, Github pro tip: Press `t` when on any github repo to bring up fuzzy matching that can be used to easily find any specific file.


Actually the install script is in the repo! See https://github.com/ddworken/hishtory/tree/master/backend/web...


+1 to prefixing with a space. hiSHtory supports this out of the box so that anything prefixed with a space isn't recorded (even if your shell doesn't do that by default!). And if you do ever mess up, `hishtory redact` can be used to delete history entries.


See https://github.com/ddworken/hishtory/issues/6 for info on how to disable control-R and how to uninstall. And sorry about this, I agree that a cleaner way to uninstall is needed and will get this implemented soon!


cool. nice interface!

another suggestion is to have a setting for the timestamp format


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: