move ksh's prompt to title_prompt as it now has support for this functionality

This commit is contained in:
David Alexander Majnemer 2009-01-16 14:41:10 -05:00
parent 5633dbd71e
commit 6e6cb7a85c
2 changed files with 24 additions and 12 deletions

View file

@ -1,12 +0,0 @@
if [ -z "${USER}" ] ; then
USER=$LOGNAME
fi
if [ -n "${USER}" ] && [ ${USER} = root ] ; then
BASE="#"
else
BASE="$"
fi
PS1=$'\E[01;32m'"${USER} "$'\E[01;34m''$PWD'" ${BASE} "$'\E[0m'
export PS1

24
ksh/title_prompt Executable file
View file

@ -0,0 +1,24 @@
if [ -z "${USER}" ] ; then
USER=$LOGNAME
fi
if [ -n "${USER}" ] && [ ${USER} = root ] ; then
BASE="#"
else
BASE="$"
fi
case $TERM in
xterm*|*rxvt*|cygwin|interix|Eterm|mlterm|kterm|aterm|putty*)
TITLE=']0;${USER}:${PWD}'
;;
screen*)
TITLE='k\\k${USER}:${PWD}\\'
;;
*)
TITLE=''
;;
esac
PS1=$TITLE$'\E[01;32m'"${USER} "$'\E[01;34m''$PWD'" ${BASE} "$'\E[0m'
export PS1