Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f3ce90d583
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (51 sloc) 1.844 kb
if [[ -e /etc/server-status ]]
then
SERVER_STATUS_ENABLED=1
fi
PROMPT_HOSTNAME=`hostname`
IMAGE_NAME=""
if [[ -e /etc/issue ]]
then
IMAGE_NAME="`grep 'Image:' /etc/issue|sed 's/Image: *\([^ ]\+\).*/\1/'`"
fi
function setup_prompt {
RPROMPT=`echo -ne "%{\033[A%}%B[%{\033[${PROMPT_USER_COLOR:-1;33}m%}%n%{\033[0m%}%B@%{\033[${PROMPT_HOST_COLOR:-1;33}m%}$PROMPT_HOSTNAME%b%B][%{\033[1;32m%}%T%b%B]%{\033[B%}"`
PROMPT=`echo -ne "\n%{\033[0m%}%B[%{\033[36m%}%~%b%B]%#"`" "
PROPOSED_VIRTUAL_ENV=$(check_unset_venv)
proposed_envname=`basename "$PROPOSED_VIRTUAL_ENV"`
if [[ "$SERVER_STATUS_ENABLED" == "1" ]]
then
SERVER_STATUS=`xargs echo -ne < /etc/server-status`
if [[ $SERVER_STATUS == 'LIVE!' ]]
then
COLOR="1;5;41;33m"
else
COLOR="0;30;46m"
fi
if [[ $IMAGE_NAME != '' ]]
then
IMAGENAME="%B[%b$IMAGE_NAME%B]%b"
fi
PROMPT=`echo -ne "%{\033[1;37m%}[%{\033[$COLOR%}$SERVER_STATUS%{\033[0;37;1m%}]%{\033[0m%}$IMAGENAME"`"$PROMPT"
unset COLOR
fi
if [[ "$VIRTUAL_ENV" != "" ]]
then
envname=`basename "$VIRTUAL_ENV"`
if [[ "$PROPOSED_VIRTUAL_ENV" != "" && "$PROPOSED_VIRTUAL_ENV" != "$VIRTUAL_ENV" ]]
then
PROMPT=`echo -ne "%{\033[1;33m%}[%{\033[0;31;43m%}$proposed_envname%{\033[0;33;1m%}]%{\033[0m%}"`"$PROMPT"
fi
PROMPT=`echo -ne "%{\033[1;36m%}[%{\033[1;34m%}$envname%{\033[36m%}]%{\033[0m%}"`"$PROMPT"
else
if [[ "$proposed_envname" != "" ]]
then
PROMPT=`echo -ne "%{\033[1;31m%}[%{\033[0;30;41;5m%}$proposed_envname%{\033[0;31;1m%}]%{\033[0m%}"`"$PROMPT"
fi
fi
}
if [[ -x /usr/bin/hostname-filter ]]
then
PROMPT_HOSTNAME=`/usr/bin/hostname-filter`
fi
setup_prompt
Jump to Line
Something went wrong with that request. Please try again.