Skip to content
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

feat(doctor): detect active preexec framework #1955

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

akinomyoga
Copy link
Contributor

See the commit messages.

Here are example outputs:

With blesh With bash-preexec No preexec framework Wrong loading order for blesh
image image image image

When blesh is loaded yet Atuin's preexec is not active (in the fourth case above), a warning message is shown as

image

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

To check if "blesh" or "bash-preexec" is loaded and active in the
current Bash session where `atuin doctor` is called, we make the Atuin
integration script for Bash to set the environment variable
`ATUIN_PREEXEC_BACKEND` and store a string when it detects "blesh" or
"bash-preexec".

To check whether the obtained ATUIN_PREEXEC_BACKEND is set by the
current session, we record SHLVL in ATUIN_PREEXEC_BACKEND and check if
it matches SHLVL of the current process.
Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! thanks

@ellie ellie merged commit 4f26963 into atuinsh:main Apr 17, 2024
17 checks passed
@akinomyoga akinomyoga deleted the bash-preexec-detect branch April 22, 2024 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants