From 6e6cb7a85cb027169ccc6594ee0e118ff6fb2d70 Mon Sep 17 00:00:00 2001 From: David Alexander Majnemer Date: Fri, 16 Jan 2009 14:41:10 -0500 Subject: [PATCH] move ksh's prompt to title_prompt as it now has support for this functionality --- ksh/prompt | 12 ------------ ksh/title_prompt | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 12 deletions(-) delete mode 100755 ksh/prompt create mode 100755 ksh/title_prompt diff --git a/ksh/prompt b/ksh/prompt deleted file mode 100755 index a25ce36..0000000 --- a/ksh/prompt +++ /dev/null @@ -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 diff --git a/ksh/title_prompt b/ksh/title_prompt new file mode 100755 index 0000000..cd8f613 --- /dev/null +++ b/ksh/title_prompt @@ -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