X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=rc%2Ffunctions;h=ec2f3114208c100b986749122cb8250d25bdfa51;hb=20dba32a51b3f2d58623ae1151987aca7a9b5f16;hp=6b42f0944894ce8048d9b250676ad28698ca9bfd;hpb=eb298eb0a42c506d6bb9c5c8def6182d872f25fc;p=clearscm.git diff --git a/rc/functions b/rc/functions index 6b42f09..ec2f311 100644 --- a/rc/functions +++ b/rc/functions @@ -23,9 +23,8 @@ function title_bar { ROOT=shift ROOT="${NORMAL}\($ROOT\)" fi - + prefix="$@" - # Change $HOME -> ~ if [ "${PWD#$HOME*}" != "$PWD" ]; then current_dir="~${PWD#$HOME*}" @@ -58,9 +57,12 @@ function title_bar { "$TERM" = "vt221" ]; then string=$(echo "${SYSNAME##*:}:$@") echo -n "${ESC}]2;$string\007" - elif [ "$TERM" = "cygwin" -o "$TERM" = "vt100" -o "$TERM" = "xterm" ]; then - # Here's where we set the prompt with root - PS1="\[\e]0;$prefix$current_dir\a$AQUA\]$ROOT\[$YELLOW\]$SYSNAME:\[$NORMAL\]" + elif [ "$TERM" = "cygwin" -o \ + "$TERM" = "vt100" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xtermc" -o \ + "$TERM" = "xterm-256color" ]; then + PS1="\[\e]0;$prefix$current_dir\007\]$ROOT\[$B_YELLOW\]$SYSNAME:\[$B_WHITE\]" fi } # title_bar @@ -88,9 +90,9 @@ function title { # view and a string to indicate that you are root. function set_title { if [ $($id -u) -eq 0 ]; then - ROOT="Wizard " + root="Wizard " else - ROOT= + root= fi view_name=$(scm pwv -short 2> /dev/null); @@ -101,9 +103,9 @@ function set_title { if [[ $view_name = *NONE* ]]; then view_name="" - title_bar "$ROOT" + title_bar "$root" else - title_bar "$ROOT" "View: $view_name: " + title_bar "${root}View: $view_name: " fi icon_name "${SYSNAME##*:}" @@ -112,25 +114,31 @@ function set_title { # Sets prompt on terminals listed. function set_prompt { if [ $($id -u) -eq 0 ]; then - if [ "$TERM" = "hpterm" -o \ - "$TERM" = "hp" -o \ - "$TERM" = "2392A" -o \ - "$TERM" = "dtterm" -o \ - ! -z "$DTTERM" ]; then - ROOT="${RED}Wizard$NORMAL " - elif [ "$TERM" = "vt100" -o \ - "$TERM" = "xterm" -o \ - "$TERM" = "vt220" ]; then - ROOT="${BOLD}${BLINK}Wizard$NORMAL " + if [ "$TERM" = "hpterm" -o \ + "$TERM" = "hp" -o \ + "$TERM" = "2392A" -o \ + "$TERM" = "dtterm" -o \ + "$TERM" = "vt100" -o \ + "$TERM" = "cygwin" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xtermc" -o \ + "$TERM" = "xterm-256color" -o \ + "$TERM" = "vt220" ]; then + ROOT="\[${ROOT_COLOR}\]Wizard\[$NORMAL\] " + else + ROOT="Wizard " fi else ROOT="" fi - if [ "$TERM" = "vt100" -o \ - "$TERM" = "xterm" -o \ + if [ "$TERM" = "vt100" -o \ + "$TERM" = "cygwin" -o \ + "$TERM" = "xterm" -o \ + "$TERM" = "xtermc" -o \ + "$TERM" = "xterm-256color" -o \ "$TERM" = "vt220" ]; then - PS1="$ROOT$BOLD$SYSNAME:$NORMAL" + PS1="$ROOT\[$B_YELLOW\]$SYSNAME:\[$B_WHITE\]" else PS1="$ROOT$SYSNAME:" fi