add locale safety and user check

This commit is contained in:
Matt Hamilton 2015-12-18 10:11:49 -05:00
parent 3e6785c993
commit a08039ca4a

View File

@ -22,13 +22,16 @@ CURRENT_BG='NONE'
PRIMARY_FG=black PRIMARY_FG=black
# Characters # Characters
SEGMENT_SEPARATOR="\ue0b0" function {
PLUSMINUS="\u00b1" local LC_ALL="" LC_CTYPE="en_US.UTF-8"
BRANCH="\ue0a0" SEGMENT_SEPARATOR="\ue0b0"
DETACHED="\u27a6" PLUSMINUS="\u00b1"
CROSS="\u2718" BRANCH="\ue0a0"
LIGHTNING="\u26a1" DETACHED="\u27a6"
GEAR="\u2699" CROSS="\u2718"
LIGHTNING="\u26a1"
GEAR="\u2699"
}
# Begin a segment # Begin a segment
# Takes two arguments, background and foreground. Both can be omitted, # Takes two arguments, background and foreground. Both can be omitted,
@ -62,8 +65,8 @@ prompt_end() {
# Context: user@hostname (who am I and where am I) # Context: user@hostname (who am I and where am I)
prompt_context() { prompt_context() {
if [[ ${USERNAME} != ${DEFAULT_USER} || -n ${SSH_CONNECTION} ]]; then if [[ ${USER} != ${DEFAULT_USER} || -n ${SSH_CONNECTION} ]]; then
prompt_segment ${PRIMARY_FG} default " %(!.%{%F{yellow}%}.)${USERNAME}@%m " prompt_segment ${PRIMARY_FG} default " %(!.%{%F{yellow}%}.)${USER}@%m "
fi fi
} }