X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=rc%2Ffunctions;h=458a69bbb653735a5b45e44b4c8252ff762cb49e;hb=6a057f8fcf6e86496975b2e4d0e94609d277bd67;hp=69f8aa1ed7c2a405779dd6b7f7c3f1dd4855ac53;hpb=c18e95513620e98cb01133d8911163fb7f7d5c09;p=clearscm.git diff --git a/rc/functions b/rc/functions index 69f8aa1..458a69b 100644 --- a/rc/functions +++ b/rc/functions @@ -19,7 +19,13 @@ view_name= # Function to set the title bar. Works on the terminal emulators listed. function title_bar { + if [ $# -gt 1 ]; then + ROOT=shift + ROOT="${NORMAL}\($ROOT\)" + fi + prefix="$@" + # Change $HOME -> ~ if [ "${PWD#$HOME*}" != "$PWD" ]; then current_dir="~${PWD#$HOME*}" @@ -53,7 +59,7 @@ function title_bar { string=$(echo "${SYSNAME##*:}:$@") echo -n "${ESC}]2;$string\007" elif [ "$TERM" = "cygwin" -o "$TERM" = "vt100" -o "$TERM" = "xterm" ]; then - PS1="\[\e]0;$prefix$current_dir\a\e[01;33m\]$SYSNAME:\[\e[0m\]" + PS1="\[\e]0;$prefix$current_dir\a$ROOT\e[01;33m\]$SYSNAME:\[\e[0m\]" fi } # title_bar @@ -96,7 +102,7 @@ function set_title { view_name="" title_bar "$ROOT" else - title_bar "${ROOT}View: $view_name: " + title_bar "$ROOT" "View: $view_name: " fi icon_name "${SYSNAME##*:}"