1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-12-26 03:27:30 +00:00

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

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