mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 03:40:41 +01:00
Merge pull request #146 from JayXon/patch-2
Support for advanced usage in custom message
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user