This commit is contained in:
Olivier Mengué 2012-08-14 15:11:48 +02:00
parent 413fc068c7
commit 24858a4fdd

View File

@ -293,17 +293,17 @@ _lp_user()
_lp_connection()
{
if [[ -n "$SSH_CLIENT$SSH2_CLIENT" ]] ; then
echo ssh
else
# TODO check on *BSD
local sess_src=$(who am i | sed -n 's/.*(\(.*\))/\1/p')
if [[ -z "$sess_src" || "$sess_src" = :0.0 ]] ; then
echo lcl # Local
else
echo tel # Telnet
fi
fi
if [[ -n "$SSH_CLIENT$SSH2_CLIENT" ]] ; then
echo ssh
else
# TODO check on *BSD
local sess_src=$(who am i | sed -n 's/.*(\(.*\))/\1/p')
if [[ -z "$sess_src" || "$sess_src" = :0.0 ]] ; then
echo lcl # Local
else
echo tel # Telnet
fi
fi
}
# Put the hostname if not locally connected
@ -313,15 +313,15 @@ _lp_connection()
# build this just once
case "$(_lp_connection)" in
lcl)
if [[ $LP_HOSTNAME_ALWAYS == 0 ]] ; then
LP_HOST="${NO_COL}" # no hostname if local
else
LP_HOST="${NO_COL}@${LP_COLOR_HOST}${_LP_HOST_SYMBOL}${NO_COL}"
fi
;;
if [[ $LP_HOSTNAME_ALWAYS == 0 ]] ; then
LP_HOST="${NO_COL}" # no hostname if local
else
LP_HOST="${NO_COL}@${LP_COLOR_HOST}${_LP_HOST_SYMBOL}${NO_COL}"
fi
;;
ssh)
LP_HOST="${NO_COL}@${LP_COLOR_SSH}${_LP_HOST_SYMBOL}${NO_COL}"
;;
;;
tel)
LP_HOST="${NO_COL}@${LP_COLOR_TELNET}${_LP_HOST_SYMBOL}${NO_COL}"
;;
@ -981,4 +981,4 @@ prompt_OFF()
# By default, sourcing liquidprompt.bash will activate the liquid prompt
prompt_on
# vim: set ts=4 sw=4 tw=120 ft=sh:
# vim: set et sts=4 sw=4 tw=120 ft=sh: