Only show '@' in prompt when a user is present

pull/2/head
Bodaniel Jeanes 2011-10-24 11:18:21 -05:00
parent 1cb715649c
commit cf09f1b575
1 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,6 @@ function prompt_pwd() {
} }
# TODO: # TODO:
# - Make '@' not present when SSHd in as 'bjeanes'
function precmd { function precmd {
vcs_info vcs_info
@ -76,10 +75,12 @@ function precmd {
if [[ "$user" == "root" ]] then if [[ "$user" == "root" ]] then
user_at_host="$pr_red$user_at_host$pr_reset" user_at_host="$pr_red$user_at_host$pr_reset"
fi fi
user_at_host+="@"
fi fi
if [[ -n "$SSH_TTY" ]]; then if [[ -n "$SSH_TTY" ]]; then
user_at_host+="$pr_blue@`hostname -s`$pr_reset" user_at_host+="$pr_blue`hostname -s`$pr_reset"
fi fi
local rev="$pr_grey$vcs_info_msg_0_$pr_reset" local rev="$pr_grey$vcs_info_msg_0_$pr_reset"