mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 20:00:38 +01:00
Support for advanced usage in custom message
For example export BULLETTRAIN_CUSTOM_MSG=\$SOME_ENV_I_WANT_TO_SHOW export BULLETTRAIN_CUSTOM_MSG=\`some command I want to run\`
This commit is contained in:
@@ -158,7 +158,7 @@ more details.
|
|||||||
|
|
||||||
|Variable|Default|Meaning
|
|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_BG`|`black`|Background color
|
||||||
|`BULLETTRAIN_CUSTOM_FG`|`black`|Foreground color
|
|`BULLETTRAIN_CUSTOM_FG`|`black`|Foreground color
|
||||||
|
|
||||||
|
|||||||
@@ -380,7 +380,9 @@ prompt_custom() {
|
|||||||
return
|
return
|
||||||
fi
|
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
|
# Git
|
||||||
|
|||||||
Reference in New Issue
Block a user