I narrowed down, that the failing command in .bashrc is eval “$(atuin init bash)”.
I belief, the atuin init bash script that it tries to evaluate causes the error at this line:
elif [[ $- != i ]]; then
# Enable only in interactive shells
false
After every command it complains about this error and doesn’t add the command to the history. If I run something from the history, the problem is gone and atuin works like it should.
I do not understand, what exactly is going wrong, nor how to solve this. Can anybody help me with this issue?
Just a drive-by observation here; that error message suggests that there’s a subtraction evaluation happening, i.e. something - somethingelse and the somethingelse is missing. The something, here the value 1725026352513710, looks like a (longer version of a) Unix epoch timestamp. And the only place I can see in atuin.bash that does this sort of thing is in __atuin_precmd() here:
I’ve spent the last two days looking into this a little deeper than what was mentioned here. Here are a few things I have found:
entering a devbox shell specifically does not trigger the __atuin_preexec() function. Therefore, __atuin_preexec_time is never set, resulting in the error at the top of this thread.
Specifically setting an init_hook in devbox.json will fix the issue as long as there is output (to trigger __atuin_preexec), but this is not ideal.
atuin v17.2.1 does not have this issue since it was released shortly before changes to the duration were made. I do not have any issues running v17.2.1 with devbox.
I also noticed that it only errored when I typed devbox shell, not if I used the atuin history and selected the devbox shell command and ran it from there. Additionally, after running a couple commands in the devbox shell, the __atuin_preexec_time is set and the error goes away.
Although both @underdunk and I have ran into this issue while using devbox, I think the issue is more to do with the bash-preexec hook not being called when entering the shell.
Would it be enough in __atuin_precmd() to do something like: