atuinsh / atuin

✨ Magical shell history
https://atuin.sh
MIT License
20.37k stars 554 forks source link

`command` missing from autin but present in `history | grep "command"` #1767

Open weltonrodrigo opened 7 months ago

weltonrodrigo commented 7 months ago

I have a lot of commands starting with kcat but a CTRL-R kcat don't find them in atuin. When I do a history | grep kcat they show up.

If you need any further information about my environment I can provide.

One entry in history is (the line breaks are part of the command):

 5926  kcat -G spiaasdfs -t novo_saver \\n-b XXXXXXXXXXXX \\n-X security.protocol=sasl_ssl \\n-X sasl.mechanism=PLAIN \\n-X sasl.username='XXXXX' \\n-X sasl.password="XXXXXXXXX" -C -o begin -c 1000 > /tmp/XXXXXXX

Also, fzf can find them

ahsandar commented 7 months ago

I also see lot of commands are not in atuin history, initially I thought it was not adding commands that exited with an error but thats not the case. It just misses out on commands and its getting worse

arcuru commented 7 months ago

This is likely the oft-referenced bug with bash-preexec. The main branch has a potential fix if you can update to that. See #1750

If you're not using bash and bash-preexec then please let us know the shell you're using

weltonrodrigo commented 7 months ago

I'm using zsh with oh-my-zsh. Was using fzf before atuin.

arcuru commented 7 months ago
  1. Are you referring to commands you have in your history from before you started using Atuin? And if so, did you import the history from zsh?
  2. How are you initializing atuin in your zshrc file?
weltonrodrigo commented 7 months ago
  • Are you referring to commands you have in your history from before you started using Atuin? And if so, did you import the history from zsh?

Yes. I followed the steps on https://docs.atuin.sh/#quickstart with atuin import auto

I believe I have older commands (as per history's command number).

  • How are you initializing atuin in your zshrc file?

Followed https://docs.atuin.sh/guide/installation/#shell-plugin with eval "$(atuin init zsh)"

ellie commented 7 months ago

Yes. I followed the steps on https://docs.atuin.sh/#quickstart with atuin import auto

Did the output of running the import have the correct number of commands?

Sometimes, depending on your shell setup, it may not have found the correct file

You can specify this with HISTFILE=./path/to/the/file atuin import zsh

Otherwise, is it dropping new commands or only failing to find older commands?

@ahsandar if you're using bash, @arcuru's earlier advice applies. If not, please open another issue with your setup + issue

ahsandar commented 7 months ago

yes I am on bash. The atuin import auto worked fine and whenever command was missed running it imported it fine. I uninstalled and built from source and since then there hasn't been an issue