4 ms·
I love how it looks and I love some of the fancy features. But above all, it's a solution to two real problems I had. I work in several terminals. Sometimes t
by berkes 3y ago
I love how it looks and I love some of the fancy features.
But above all, it's a solution to two real problems I had.
I work in several terminals. Sometimes tabs or Windows in my emulator, sometimes screen or tmux. And all those sessions would overwrite eachothers history. I lost many actual important history entries that way. And I (almost) ran many wrong commands, expecting another one to be my last entry. Arrow-up enter. Woops.
Atuin solved this.
I had my history as large as possible. Ctrl-r is my friend to search for "that old thing I did to pgsql piping something from zcat a year ago". But it's ever slower, zsh and bash history clearly not designed to handle (tens of) thousands of entries.
Atuin solved this.
- gitinit 3y agoAgreed! This is my exact use case for Atuin and it works great, except it replaces the default, minimal control-r interface.
- n8henrie 3y agoInteresting -- I have histappend (? I think) enabled and no problems with 20+ simultaneous tmux panes + tabs. Just checked yesterday* and have well over 100k lines in bash history and it loads / searches instantly in skim. * Was trying to check out mcfly vs atuin for the third time and again didn't understand why the extra complexity was worthwhile.
- tupolef 3y ago- For your 1st issue, you can setup bash to append commands rather than overwrite them. Here the part of my .bashrc about history: # append rather than overwrite shopt -s histappend # attempts to save all lines of a multiple-line command in the same history entry shopt -s cmdhist # with cmdhist, saved with embedded newlines rather than semicolon separators shopt -s lithist HISTCONTROL=ignoreboth HISTSIZE=10000 HISTFILESIZE=20000 HISTTIMEFORMAT="%y/%m/%d %T " HISTIGNORE="history:ls:l:pwd:exit:" if [[ ${BASH_VERSION:0:1} -gt 5 || ${BASH_VERSION:0:1} -ge 5 && ${BASH_VERSION:2:1} -ge 1 ]]; then PROMPT_COMMAND=("history -a" "history -c" "history -r") else PROMPT_COMMAND="history -a; history -c; history -r" fi - And about the 2nd issue, you should use fzf or skim (probably faster) to replace the ctrl-r binding. fzf includes such a script that you just need to call from .bashrc. # Enable key bindings for fzf if command -v fzf 1> /dev/null && [[ -f "/usr/share/doc/fzf/examples/key-bindings.bash" ]]; then source /usr/share/doc/fzf/examples/key-bindings.bash fi
- sjagoe 3y agoI had been using the history append for years before finding atuin a couple years ago. I still occassionally lost history through some combination of events I was never able to understand. I've been using atuin happily for a few years now and it blows bash history out of the water.
- berkes 3y agoI had nearly the exact setup. But I never fully understood it. And despite tweaks, it kept loosing some history entries. Not a huge problem, until it was :) I have far more confidence in atuin handling race-conditions and upserts than in my bash-spagetti not doing that. Also, fzf, has a better append-history, but even there I managed to get it into some race-condition now and again. I presume it has to do with when the append happens: after the command ran and finished vs when I hit enter? Again, I don't know the details, and frankly, don't really want to know them either, if I can just lean on a tool by people who truly understand the problem.
- jcynix 3y ago>For your 1st issue, you can setup bash to append commands rather than overwrite them. Good, but even better (IMHO) is to write one history file for each terminal window, shell and level as in export HISTFILE=$HOME/.history/${TTY##*/}.$SHLVL And then I tell zsh to add timestamps setopt APPENDHISTORY # don't overwrite HISTFILE setopt EXTENDEDHISTORY # add timestamps to HISTFILE setopt HISTIGNORESPACE # aka setopt -g set HIST_FIND_NO_DUPS # don't show duplicates on ctrl-R Now I can grep my history and, based on other work notes I take, can even limit my search by date/time if needed.
- wyclif 3y agoLooks like whoever created the examples uses LunarVim.