1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-01 09:13:54 +00:00

fix(bash): init breaks if PROMPT_COMMAND includes starship_precmd as an intermediate command (#1541)

This commit is contained in:
Jason Wang 2020-08-03 13:05:31 -07:00 committed by GitHub
parent 09f3b2a8dd
commit 14f7cd461c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ else
# add multiple instances of the starship function and keep other user functions if any. # add multiple instances of the starship function and keep other user functions if any.
if [[ -z "$PROMPT_COMMAND" ]]; then if [[ -z "$PROMPT_COMMAND" ]]; then
PROMPT_COMMAND="starship_precmd" PROMPT_COMMAND="starship_precmd"
elif [[ "$PROMPT_COMMAND" != *"starship_precmd" ]]; then elif [[ "$PROMPT_COMMAND" != *"starship_precmd"* ]]; then
# Appending to PROMPT_COMMAND breaks exit status ($?) checking. # Appending to PROMPT_COMMAND breaks exit status ($?) checking.
# Prepending to PROMPT_COMMAND breaks "command duration" module. # Prepending to PROMPT_COMMAND breaks "command duration" module.
# So, we are preserving the existing PROMPT_COMMAND # So, we are preserving the existing PROMPT_COMMAND