Skip to content

atuin doctor - check to see if atuin is initialised properly #3197

@RobertKielty

Description

@RobertKielty

In bash, if a user modifies their shell prompt (after calling atuin init bash) this breaks command recording in atuin.

The fix is make sure that the following commands appear at the end of whatever bash configuration file your are using to configure bash.

# atuin init MUST run last at shell startup time.  
# Specifically, init must run after any PS1 prompt function definition
# otherwise this stops atuin from recording commands to the database.
. "$HOME/.atuin/bin/env"
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"

This may be a big ask due to the number of shells atuin supports and the need to a complete a postgraduate taught/research program to fully understand how interactive shells are configured using files, so if too hard, please close, but here's the ask:

Have atuin doctor detect if the running of atuin init bash happens last in .bashrc

or

report the last command record time and if older than today, have the doctor output suggest that command recording is broken due to user error via shell prompt hacking.

Thank you for atuin, it's awesome. Thank you pointing me in the direction of ble.sh, also brilliant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions