diff --git a/README.md b/README.md index c3fbcbc..1740835 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ NOTE: You do not need to specify *end* segment - it will be added automatically. |Variable|Default|Meaning |--------|-------|-------| -|`BULLETTRAIN_CUSTOM_MSG`|`false`|Free segment you can put a custom message +|`BULLETTRAIN_CUSTOM_MSG`|`false`|Free segment you can put a custom message which will be eval'ed for every prompt |`BULLETTRAIN_CUSTOM_BG`|`black`|Background color |`BULLETTRAIN_CUSTOM_FG`|`black`|Foreground color diff --git a/bullet-train.zsh-theme b/bullet-train.zsh-theme index 29b730c..783b7bd 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -393,7 +393,9 @@ prompt_custom() { return fi - prompt_segment $BULLETTRAIN_CUSTOM_BG $BULLETTRAIN_CUSTOM_FG "${BULLETTRAIN_CUSTOM_MSG}" + local custom_msg + eval custom_msg=$BULLETTRAIN_CUSTOM_MSG + [[ -n "${custom_msg}" ]] && prompt_segment $BULLETTRAIN_CUSTOM_BG $BULLETTRAIN_CUSTOM_FG "${custom_msg}" } # Git