-
-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
atuin not saving new commands into local database #380
Comments
Hmm, very perplexing. Just to ensure that the setup is valid, could you check for the existence of the ATUIN_SESSION environment variable? |
Oh interesting 🤔 The WAL file should be getting periodically written to the main database, I wonder why it's not happening here Could you try opening the sqlite file with
and then run
and share the output please :) This should force a checkpoint, and then truncate the wal file. See: https://www.sqlite.org/pragma.html#pragma_wal_checkpoint |
Exists
|
Note that I have since disabled atuin, started a new shell, blown away the old db, re-ran |
I'm using sync and seeing the same issue. As with Ben's report, ATUIN_SESSION exists and the checkpoint returned Another data point of interest: I haven't overridden the default sync, but
|
I have the same issues, reproducible on all 3 different hosts (macOS 11 and macOS 12). |
So it sounds like this is happening on both Bash and Zsh?
@peterjanes, if you run I'm wondering if there's something funky going on with the shell hooks |
|
Hmmm interesting. could anyone with this issue try running
and then see what's logged? Might shed light onto things. We do also need to sort out the logging experience 😅 Otherwise - what version of Atuin are people running, and which shell? I'd basically like to determine if this is atuin not being called properly in the first place, or if it IS being called, and not inserting for some reason. A reboot would have triggered a new login, and hence a new load of .zprofile or .bash_profile, which could be messing with things here |
I don't see any log messages or files being created with the RUST_LOG variable set. However, I have seen this message occasionally (without the variable) and I'm pretty sure it's new since atuin:
Curiously, my |
Aha, a data point here: I'm using bash-git-prompt and if I disable it in my .bash_profile atuin starts to update its records again. (It's executed after atuin.)
|
This would imply that atuin is not running at all (the hooks would not be enabled)
Ah ok! Now we are somewhere. Atuin for bash should be additive to your shell hooks. So you should be able to enable it after |
Can't speak for the zsh-ers but moving the init for bash-git-prompt worked here. |
I use (and combined) with starship.rs; I have the same issues. |
I'm using starship.rs as well, on zsh, with no issues Bash doesn't actually offer the hooks we need out of the box - so we use this - https://github.com/rcaloras/bash-preexec @jovandeginste what shell is that? |
bash |
I tried to clean a bit up (I used fzf bindings before). I do have |
I think that did the trick for me... disabled the bash pre-exec (I got it from here) |
... and now I upgraded that script (from V0.4.1 to V0.5.0) and it seems to work...! |
I have a fairly complex (mostly) homemade prompt which uses (among other things) git-radar, oc (for OpenShift/k8s), a local fn for formatting, and of course PROMPT_COMMAND. "Source this file at the end of your bash profile so as not to interfere with...PROMPT_COMMAND" but then also "This module requires...Bash features which you must not otherwise be using...the "PROMPT_COMMAND" variable. If you override...these after bash-preexec has been installed it will most likely break" TL;DR - I probably have some PROMPT_COMMAND debug/engineering to do |
I'm going to close this one for now, it doesn't look like there's much we can do If you're facing this problem, please ensure that your PROMPT and bash-preexec are not conflicting with each other! You may need to change the order of some commands in your bashrc. |
Maybe not related but for information, I had similar symptom and the reason for me was triple initialization by running the installer script three times over time. The first one had manual edit for disabling up arrow.
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash --disable-up-arrow)"
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)" |
@sftblw's fix worked for me as well. For me, I had manually pasted atuin init bash into .bashrc to override the system not accepting adjustments to the key bindings and inadvertently commented out the existing part of .bashrc:
The errors I was receiving prior to this were:
Unfortunately, now it syncs but the key_binding has gone back to opening atuin via up-arrow |
I just ran into this setting up a new machine. In my case the issue was not having
|
For me the solution was to remove the |
I ran into this problem when an old version (0.4.1) of WezTerm has updated their bundled version of |
Brancd new Atuin user, also experiencing this problem. However I use Zsh, so much of the later discussion (e.g., I followed the recommended instructions to install Atuin: bash -c "<(curl https://raw.githubusercontent.com/atuinsh/atuin/main/install.sh)" Then, I registered and ran
I now see Atuin, loaded with all of my old history, and the keybindings work as desired. However, when I execute new commands, they don't show up in Atuin. I do see them in I have attempted some light debugging, consisting mostly of deactivating plugins to avoid muddying the waters. But the problem persists. Can @ellie or any fellow Zsh users assist? Absolutely beautiful project btw :) |
Following up on my earlier comment... So I think I figured it out. Pre-Atuin, my Not sure if this is a known bug or something I was just doing wrong, but anyway, I seem to have resolved my issues for now! Edit: Since Atuin is a radical new way of tracking history, I'd be curious to know the extent to which zsh's typical history options still have an impact. For example, |
Oh interesting! Definitely a bug. Would you be able to open a new issue for this specific problem please? I'm going to lock this issue now, as this is getting quite difficult to follow
It shouldn't impact us at all. Atuin uses shell hooks to record history, and doesn't interact with the actual shell history mechanism |
I installed atuin per the README on 2022-04-28, in what I presume is local-only mode (i.e. I didn't set up any kind of sync).
I then imported my bash history, which worked great (very fast as well).
Today (2022-05-02), I noticed that recent commands seem to be missing.
~/.local/share/atuin/ looks like...
dir. .local/share/atuin/ total 6.2M -rw-r--r--. 1 xxxx xxxx 1.9M Apr 28 17:20 history.db -rw-r--r--. 1 xxxx xxxx 32K May 2 16:09 history.db-shm -rw-r--r--. 1 xxxx xxxx 4.3M Apr 28 17:21 history.db-wal # 'xxxx' is my redacted local username
...so indeed the DB isn't being updated. Config is straight defaults.
(Note that I rebooted a couple of hours ago, so ALL shells have been restarted :D)
Am I missing some configuration magic?
Footnote: The fact that
history.db-shm
has a current timestamp suggests to me that atuin is doing its job in writing new entries, but given that I rebooted, I should think that the transactions would've been written back...The text was updated successfully, but these errors were encountered: