summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Song <chipbuster@users.noreply.github.com>2019-08-20 20:49:07 -0700
committerMatan Kushner <hello@matchai.me>2019-08-20 23:49:07 -0400
commitf06247d5d3af925ce5c8526ca6a3050d14d375f5 (patch)
tree22b26afcc51be10543b54464a95da37546387f58 /src
parentdcb78a4e0bba9bf5084f69a470603422733b151d (diff)
fix: Correct ZSH init on older ZSH versions (#213)
Diffstat (limited to 'src')
-rw-r--r--src/init.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init.rs b/src/init.rs
index 4fb6882ef..f0e8bd42a 100644
--- a/src/init.rs
+++ b/src/init.rs
@@ -187,7 +187,7 @@ starship_precmd() {
STATUS=$?
# 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_DURATION=$((STARSHIP_END_TIME - STARSHIP_START_TIME))
PROMPT="$(starship prompt --status=$STATUS --cmd-duration=$STARSHIP_DURATION --jobs="$(jobs | wc -l)")"