fix: Remove trailing semicolon from `$PROMPT_COMMAND` (#784)

Remove any trailing semicolon in $PROMPT_COMMAND before appending starship_precmd, to prevent syntax error.
This commit is contained in:
InNoobWeTrust 2019-12-28 22:03:59 +07:00 committed by Matan Kushner
parent 36cfbfcf03
commit 9d49410102
1 changed files with 2 additions and 1 deletions

View File

@ -70,7 +70,8 @@ else
if [[ -z "$PROMPT_COMMAND" ]]; then
PROMPT_COMMAND="starship_precmd"
elif [[ "$PROMPT_COMMAND" != *"starship_precmd" ]]; then
PROMPT_COMMAND="$PROMPT_COMMAND;starship_precmd"
# Remove any trailing semicolon before appending (PR #784)
PROMPT_COMMAND="${PROMPT_COMMAND%;};starship_precmd"
fi
fi