Live data from Hacker News

Atuin – Magical shell history

atuin.sh

51–60 of 118 posts

Re: Atuin – Magical shell history

#51

Why is this better than a shell's built-in history, possibly paired with fzf? I'm not asking sarcastically, either. Is this something awesome I should be using? What about it is going to blow my mind?

I've recently switched from zsh's built-in history + fzf, so perhaps I can answer. First, a bit more about my zsh+fzf use: I use `share_history` so that my history is available across shells, allowing me to quickly find and re-run commands. ( https://zsh.sourceforge.io/Doc/Release/Options.html#index-SH... ) Sometimes I want to switch back to some terminal tab/window and find a command that I nkow I ran in that sessio…

I’m a largely happy fzf+history user, but I think filtering across hosts is the killer app I was missing with atuin.

Re: Atuin – Magical shell history

#52
Been using atuin for a couple months now on Windows in bash. Its a very nice tool however I've been experiencing a huge lag sometimes after typing just one character. Intuition says there could be the database performance is lacking or Im missing some configuration. Anyone else experiencing something similar?

Re: Atuin – Magical shell history

#53
post #52

Been using atuin for a couple months now on Windows in bash. Its a very nice tool however I've been experiencing a huge lag sometimes after typing just one character. Intuition says there could be the database performance is lacking or Im missing some configuration. Anyone else experiencing something similar?

Could be a disk Io issue. I know git used to use a nieve approach on windows and it make git incredibly slow. Something you wouldn't notice just using git but when you made it part of your prompt it would lag for a good second and a half just pressing enter.

Re: Atuin – Magical shell history

#54
post #13

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…

Interesting -- 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.

Re: Atuin – Magical shell history

#55

Why is this better than a shell's built-in history, possibly paired with fzf? I'm not asking sarcastically, either. Is this something awesome I should be using? What about it is going to blow my mind?

It works for multiple shells and synchronizes history between devices.

Re: Atuin – Magical shell history

#56
post #44

I've been using this for a couple months after using McFly in zsh for over a year. I think I can say that I like it better, but the only thing I sometimes don't like is how it completely takes over your screen when you press the up arrow. I usually just want to get the previous command I entered instead of the whole searchable history (which I use Control-R to bring up), and it's really jarring to have the entire scr…

Same here, but you can disable that behaviour, and then it’s nicer [0]. I also find that I prefer the default Ctrl-R to start with history from the current directory instead of the global history, but that is also changeable. So I’m pretty happy. [0]: https://docs.atuin.sh/configuration/key-binding/#disable-up-...

Awesome, thanks for the tip, I’ll try that.

Re: Atuin – Magical shell history

#57
Atuin is great! Considering including it in my little stack of scripts to turn a new Ubuntu VM into a capable devbox from scratch [1].

We currently install `fzf` with the proper keybindings, so Ctrl-R is already quite nice. But we also already include one interactive "pick your $EDITOR" moment - there's no reason we couldn't provide a "pick your $HISTORIAN" with atuin vs fzf as well. It would be fun and might turn people onto new tools, which is a big aim of this project.

[1]: https://github.com/hiAndrewQuinn/shell-bling-ubuntu

Re: Atuin – Magical shell history

#58
post #13

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…

- 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

Re: Atuin – Magical shell history

#59

I switched a year or two ago It wasn't until I switched that I realized how poor bash and zsh are in comparison, even with fzf 10 min install, never looked back Not to mention the safety. Never could figure it out, but once every 15 months or so, zsh would disappear my history. Certainly a mistake on my end, but still too easy to blow away history

I would occasionally manage to start a bash shell without executing my profile, which means HISTFILESIZE is not set and bash would truncate my history on the first command I ran. zsh history may have a similar problem.

Yes, bad defaults strike again!
Post reply on HN