fix: Correct ZSH init on older ZSH versions (#213)

This commit is contained in:
Kevin Song 2019-08-20 20:49:07 -07:00 committed by Matan Kushner
parent dcb78a4e0b
commit f06247d5d3
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ starship_precmd() {
STATUS=$? STATUS=$?
# Compute cmd_duration, if we have a time to consume # Compute cmd_duration, if we have a time to consume
if [[ $STARSHIP_START_TIME ]]; then if [[ ! -z "${STARSHIP_START_TIME+1}" ]]; then
STARSHIP_END_TIME="$(date +%s)" STARSHIP_END_TIME="$(date +%s)"
STARSHIP_DURATION=$((STARSHIP_END_TIME - STARSHIP_START_TIME)) STARSHIP_DURATION=$((STARSHIP_END_TIME - STARSHIP_START_TIME))
PROMPT="$(starship prompt --status=$STATUS --cmd-duration=$STARSHIP_DURATION --jobs="$(jobs | wc -l)")" PROMPT="$(starship prompt --status=$STATUS --cmd-duration=$STARSHIP_DURATION --jobs="$(jobs | wc -l)")"