Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 2c04013270
Fetching contributors…

Cannot retrieve contributors at this time

executable file 35 lines (31 sloc) 0.777 kB
function do_prompt ()
{
if [ $? -ne 0 ] ; then
local ERROR_PROMPT="\[\033[01;31m\]"
fi
local BASE
if [ $UID -ne 0 ] ; then
BASE="$"
else
BASE="#"
fi
local TITLEBAR
case $TERM in
xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*)
if [ "${STY}" ] ; then
TITLEBAR='\[\033k\u@\h:\w\033\134\]'
else
TITLEBAR='\[\033]1;\u@\h:\w\007\033]2;\u@\h:\w\007\]'
fi
;;
screen*)
TITLEBAR='\[\033k\u@\h:\w\033\134\]'
;;
*)
TITLEBAR=''
;;
esac
PS1="${TITLEBAR}\[\033[01;32m\]\u@\h \[\033[01;34m\]\w ${ERROR_PROMPT}${BASE} \[\033[00m\]"
export PS1
}
PROMPT_COMMAND=do_prompt
Jump to Line
Something went wrong with that request. Please try again.