Merge pull request #1446 from davidpfarrell/short-user-hostname

Adds SHORT_USER/HOSTNAME support to powerline themes
pull/1468/head
Nils Winkler 2019-12-27 17:10:08 +01:00 committed by GitHub
commit eb21a1da6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -30,10 +30,11 @@ function __powerline_user_info_prompt {
fi fi
;; ;;
*) *)
local user=${SHORT_USER:-${USER}}
if [[ -n "${SSH_CLIENT}" ]] || [[ -n "${SSH_CONNECTION}" ]]; then if [[ -n "${SSH_CLIENT}" ]] || [[ -n "${SSH_CONNECTION}" ]]; then
user_info="${USER_INFO_SSH_CHAR}${USER}" user_info="${USER_INFO_SSH_CHAR}${user}"
else else
user_info="${USER}" user_info="${user}"
fi fi
;; ;;
esac esac
@ -119,7 +120,7 @@ function __powerline_cwd_prompt {
} }
function __powerline_hostname_prompt { function __powerline_hostname_prompt {
echo "$(hostname -s)|${HOST_THEME_PROMPT_COLOR}" echo "${SHORT_HOSTNAME:-$(hostname -s)}|${HOST_THEME_PROMPT_COLOR}"
} }
function __powerline_wd_prompt { function __powerline_wd_prompt {