Skip to content

Commit 52c4ce2

Browse files
committed
Conditional output of color codes for prompt char
1 parent d86f1f9 commit 52c4ce2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

agkozak-zsh-prompt.plugin.zsh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ typeset -g AGKOZAK_COLORS_EXIT_STATUS=${AGKOZAK_COLORS_EXIT_STATUS:-red}
9595
typeset -g AGKOZAK_COLORS_USER_HOST=${AGKOZAK_COLORS_USER_HOST:-green}
9696
typeset -g AGKOZAK_COLORS_PATH=${AGKOZAK_COLORS_PATH:-blue}
9797
typeset -g AGKOZAK_COLORS_BRANCH_STATUS=${AGKOZAK_COLORS_BRANCH_STATUS:-yellow}
98-
typeset -g AGKOZAK_COLORS_PROMPT_CHAR=${AGKOZAK_COLORS_PROMPT_CHAR:-white}
9998

10099
setopt PROMPT_SUBST NO_PROMPT_BANG
101100

@@ -754,9 +753,9 @@ _agkozak_prompt_string () {
754753
PROMPT+='%(3V.%F{${AGKOZAK_COLORS_BRANCH_STATUS}}%3v%f.)'
755754
fi
756755
PROMPT+='${AGKOZAK_PROMPT_WHITESPACE}'
757-
PROMPT+='%F{${AGKOZAK_COLORS_PROMPT_CHAR}}'
756+
PROMPT+='${AGKOZAK_COLORS_PROMPT_CHAR:+%F{${AGKOZAK_COLORS_PROMPT_CHAR}\}}'
758757
PROMPT+='%(4V.${AGKOZAK_PROMPT_CHAR[3]:-:}.%(!.${AGKOZAK_PROMPT_CHAR[2]:-%#}.${AGKOZAK_PROMPT_CHAR[1]:-%#}))'
759-
PROMPT+='%f '
758+
PROMPT+='${AGKOZAK_COLORS_PROMPT_CHAR:+%f} '
760759

761760
typeset -g AGKOZAK_CUSTOM_PROMPT=${PROMPT}
762761
typeset -g AGKOZAK_CURRENT_CUSTOM_PROMPT=${AGKOZAK_CUSTOM_PROMPT}

0 commit comments

Comments
 (0)