1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-12-18 05:40:07 +00:00

Trying to enable always showing user, not working

This commit is contained in:
Ben Hilburn 2017-02-13 22:29:58 -05:00
parent 3de352b296
commit 6512796afe

View file

@ -538,6 +538,7 @@ prompt_public_ip() {
# Context: user@hostname (who am I and where am I)
# Note that if $DEFAULT_USER is not set, this prompt segment will always print
set_default POWERLEVEL9K_ALWAYS_SHOW_CONTEXT false
set_default POWERLEVEL9K_ALWAYS_SHOW_USER false
set_default POWERLEVEL9K_CONTEXT_HOST_DEPTH "%m"
prompt_context() {
local current_state="DEFAULT"
@ -547,7 +548,7 @@ prompt_context() {
"DEFAULT" "011"
)
local content="$USER"
local content=""
if [[ "POWERLEVEL9K_ALWAYS_SHOW_CONTEXT" == true ]] || [[ "$USER" != "$DEFAULT_USER" ]] || [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then
@ -555,10 +556,15 @@ prompt_context() {
current_state="ROOT"
fi
content="${content}@${POWERLEVEL9K_CONTEXT_HOST_DEPTH}"
content="$USER@${POWERLEVEL9K_CONTEXT_HOST_DEPTH}"
"$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${context_states[$current_state]}" "${content}"
elif [[ "POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]]; then
content="$USER"
else
return
fi
"$1_prompt_segment" "${0}_${current_state}" "$2" "$DEFAULT_COLOR" "${context_states[$current_state]}" "${content}"
}
# The 'custom` prompt provides a way for users to invoke commands and display