mirror of
https://github.com/Cornelicorn/bullet-train.zsh.git
synced 2025-12-06 03:40:41 +01:00
Allow change the context hostname to display the fqdn.
This commit is contained in:
@@ -141,6 +141,7 @@ or don't want to see. All options must be overridden in your **.zshrc** file.
|
||||
|`BULLETTRAIN_CONTEXT_BG`|`black`|Background color
|
||||
|`BULLETTRAIN_CONTEXT_FG`|`default`|Foreground color
|
||||
|`BULLETTRAIN_CONTEXT_DEFAULT_USER`|none|Default user. If you are running with other user other than default, the segment will be showed.
|
||||
|`BULLETTRAIN_CONTEXT_HOSTNAME`|`%m`|Hostname. Set %M to display the full qualified domain name.
|
||||
|`BULLETTRAIN_IS_SSH_CLIENT`|none|If `true`, the segment will be showed.
|
||||
|
||||
### Python virtualenv (+Pyenv)
|
||||
|
||||
@@ -179,6 +179,9 @@ fi
|
||||
if [ ! -n "${BULLETTRAIN_CONTEXT_FG+1}" ]; then
|
||||
BULLETTRAIN_CONTEXT_FG=default
|
||||
fi
|
||||
if [ ! -n "${BULLETTRAIN_CONTEXT_HOSTNAME+1}" ]; then
|
||||
BULLETTRAIN_CONTEXT_HOSTNAME=%m
|
||||
fi
|
||||
|
||||
# GIT PROMPT
|
||||
if [ ! -n "${BULLETTRAIN_GIT_PREFIX+1}" ]; then
|
||||
@@ -306,7 +309,7 @@ prompt_end() {
|
||||
# Context: user@hostname (who am I and where am I)
|
||||
context() {
|
||||
local user="$(whoami)"
|
||||
[[ "$user" != "$BULLETTRAIN_CONTEXT_DEFAULT_USER" || -n "$BULLETTRAIN_IS_SSH_CLIENT" ]] && echo -n "${user}@%m"
|
||||
[[ "$user" != "$BULLETTRAIN_CONTEXT_DEFAULT_USER" || -n "$BULLETTRAIN_IS_SSH_CLIENT" ]] && echo -n "${user}@$BULLETTRAIN_CONTEXT_HOSTNAME"
|
||||
}
|
||||
prompt_context() {
|
||||
[[ $BULLETTRAIN_CONTEXT_SHOW == false ]] && return
|
||||
|
||||
Reference in New Issue
Block a user