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
1 changed files with 1 additions and 1 deletions

View File

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