Fix username display on Mac

Mac UIDs don't match my assumed behavior.  Remove the check for UID since it was
never used anyway.
This commit is contained in:
Andrew Tomaka 2014-07-09 18:51:11 -04:00
parent ed4bd6271a
commit 4d10652df2

View file

@ -6,21 +6,16 @@ autoload -U colors zsh/terminfo # Used in the colour alias below
colors colors
setopt prompt_subst setopt prompt_subst
# make some aliases for the colours: (coud use normal escap.seq's too) # make some aliases for the colors: (coud use normal escap.seq's too)
for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GRAY; do for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE GRAY; do
eval PR_$color='%{$fg[${(L)color}]%}' eval PR_$color='%{$fg[${(L)color}]%}'
done done
eval PR_NO_COLOR="%{$terminfo[sgr0]%}" eval PR_NO_COLOR="%{$terminfo[sgr0]%}"
eval PR_BOLD="%{$terminfo[bold]%}" eval PR_BOLD="%{$terminfo[bold]%}"
# Check the UID # Username
if [[ $UID -ge 1000 ]]; then # normal user eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}'
eval PR_USER='${PR_GREEN}%n${PR_NO_COLOR}' eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}'
eval PR_USER_OP='${PR_GREEN}%#${PR_NO_COLOR}'
elif [[ $UID -eq 0 ]]; then # root
eval PR_USER='${PR_RED}%n${PR_NO_COLOR}'
eval PR_USER_OP='${PR_RED}%#${PR_NO_COLOR}'
fi
# Check if we are on SSH or not # Check if we are on SSH or not
if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then if [[ -n "$SSH_CLIENT" || -n "$SSH2_CLIENT" ]]; then