diff --git a/README.md b/README.md index 6be3e46..9371197 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ more details. |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 8314623..dbfd55a 100644 --- a/bullet-train.zsh-theme +++ b/bullet-train.zsh-theme @@ -380,7 +380,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