Skip to content

feat(doctor): detect active preexec framework#1955

Merged
ellie merged 2 commits into
atuinsh:mainfrom
akinomyoga:bash-preexec-detect
Apr 17, 2024
Merged

feat(doctor): detect active preexec framework#1955
ellie merged 2 commits into
atuinsh:mainfrom
akinomyoga:bash-preexec-detect

Conversation

@akinomyoga

Copy link
Copy Markdown
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.

@ellie ellie left a comment

Copy link
Copy Markdown
Member

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
@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