Merge branch 'host_user' of https://github.com/onaforeignshore/powerlevel9k into onaforeignshore-host_user

pull/22/head
Ben Hilburn 8 years ago
commit d9014c67a3

@ -552,8 +552,8 @@ POWERLEVEL9K_ROOT_ICON="#"
| Variable | Default Value | Description | | Variable | Default Value | Description |
|----------|---------------|-------------| |----------|---------------|-------------|
|`DEFAULT_USER`|None|Username to consider a "default context" (you can also set `$USER`).| |`DEFAULT_USER`|None|Username to consider a "default context" (you can also set it to `$USER`).|
|`POWERLEVEL9K_ALWAYS_SHOW_USER`|false|Always show the username, but conditionalize the hostname.| |`POWERLEVEL9K_ALWAYS_SHOW_USER`|false|Always show the username.|
|`POWERLEVEL9K_USER_TEMPLATE`|%n|Default username prompt (username). Refer to the [ZSH Documentation](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html) for all possible expansions| |`POWERLEVEL9K_USER_TEMPLATE`|%n|Default username prompt (username). Refer to the [ZSH Documentation](http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html) for all possible expansions|
##### vcs ##### vcs

@ -611,7 +611,7 @@ set_default POWERLEVEL9K_USER_TEMPLATE "%n"
prompt_user() { prompt_user() {
local current_state="DEFAULT" local current_state="DEFAULT"
typeset -AH user_state typeset -AH user_state
if [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]] || [[ "$USER" != "$DEFAULT_USER" ]] || [[ -n "$SSH_CLIENT" || -n "$SSH_TTY" ]]; then if [[ "$POWERLEVEL9K_ALWAYS_SHOW_USER" == true ]] || [[ "$USER" != "$DEFAULT_USER" ]]; then
if [[ $(print -P "%#") == '#' ]]; then if [[ $(print -P "%#") == '#' ]]; then
user_state=( user_state=(
"STATE" "ROOT" "STATE" "ROOT"
@ -629,8 +629,8 @@ prompt_user() {
"VISUAL_IDENTIFIER" "USER_ICON" "VISUAL_IDENTIFIER" "USER_ICON"
) )
fi fi
fi
"$1_prompt_segment" "${0}_${user_state[STATE]}" "$2" "${user_state[BACKGROUND_COLOR]}" "${user_state[FOREGROUND_COLOR]}" "${user_state[CONTENT]}" "${user_state[VISUAL_IDENTIFIER]}" "$1_prompt_segment" "${0}_${user_state[STATE]}" "$2" "${user_state[BACKGROUND_COLOR]}" "${user_state[FOREGROUND_COLOR]}" "${user_state[CONTENT]}" "${user_state[VISUAL_IDENTIFIER]}"
fi
} }
################################################################ ################################################################

Loading…
Cancel
Save