Init error in devbox shell

Hi there,

I’m new to atuin and ran into an error when atuin tries to initialize in my devbox shell.

bash: 1725026352513710 - : syntax error: operand expected (error token is "- ")

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?

Thanks, underdunk

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:

duration=$((${__atuin_precmd_time//[!0-9]} - ${__atuin_preexec_time//[!0-9]}))

which (confirmation bias aside) does seem to relate to timestamp subtractions.

So it could be in this area?

Thank you for your help.

For the moment I put a [[ ! ${__atuin_preexec_time} ]] && return as exit condition in the __atuin_precmd function.

What version of bash are you using here?

I use GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu), but inside of devbox it is GNU bash, version 5.2.26(1)-release (x86_64-pc-linux-gnu).