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

Integration with starship #24

Open
warrenc5 opened this issue Aug 3, 2023 · 1 comment
Open

Integration with starship #24

warrenc5 opened this issue Aug 3, 2023 · 1 comment

Comments

@warrenc5
Copy link

warrenc5 commented Aug 3, 2023

Ash is a great plugin and is what I have been looking for a while.

However it breaks my starship :(
Is it possible to get this and starship to work nicely together?

I had a play around adding it to .config/starship.toml but failed miserably.
I also had a look into the ASH source scripts - wow

Something to do with ...
https://starship.rs/advanced-config/#custom-pre-prompt-and-pre-execution-commands-in-bash
Or this error

Advanced Shell History enabled: session 39
❯ eval "$(starship init bash)"
bash: PROMPT_COMMAND: readonly variable
@warrenc5
Copy link
Author

This is as close as I could get to make them play nicely.

Added to my .bashrc

source /usr/local/lib/advanced_shell_history/sh/bash
ASH=1 __ash_begin_session
export ASH_CFG_SYSTEM_QUERY_FILE
eval "$(starship init bash)"

function __link_ash() {
  ASH=1 __ash_precmd
}

if [ -n "${STARSHIP_SESSION_KEY}" ] ; then
  starship_precmd_user_func="__link_ash"
fi

And I had to update
/usr/local/lib/advanced_shell_history/sh/bash around line 100

readonly ASH_SESSION_ID 
  #PROMPT_COMMAND

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

No branches or pull requests

1 participant