From c20a998d1573cb81ac44875efd3338c569d05cef Mon Sep 17 00:00:00 2001 From: Harry Sarson Date: Sat, 9 Oct 2021 18:13:49 +0100 Subject: [PATCH] fix: allow unset KEYMAP and STARSHIP_DURATION in zsh (#3124) * allow unset KEYMAP and STARSHIP_DURATION in zsh which prevents errors if a user has `set -u` on in there terminal. * fix: allow unset KEYMAP and STARSHIP_DURATION in zsh --- src/init/starship.zsh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/init/starship.zsh b/src/init/starship.zsh index 00355e0d..c4a2f9f9 100644 --- a/src/init/starship.zsh +++ b/src/init/starship.zsh @@ -91,6 +91,7 @@ export STARSHIP_SESSION_KEY=${STARSHIP_SESSION_KEY:0:16}; # Trim to 16-digits if VIRTUAL_ENV_DISABLE_PROMPT=1 setopt promptsubst -PROMPT='$(::STARSHIP:: prompt --terminal-width="$COLUMNS" --keymap="$KEYMAP" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="$STARSHIP_DURATION" --jobs="$STARSHIP_JOBS_COUNT")' -RPROMPT='$(::STARSHIP:: prompt --right --terminal-width="$COLUMNS" --keymap="$KEYMAP" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="$STARSHIP_DURATION" --jobs="$STARSHIP_JOBS_COUNT")' + +PROMPT='$(::STARSHIP:: prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")' +RPROMPT='$(::STARSHIP:: prompt --right --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'