]> git.donarmstrong.com Git - home-base.git/commitdiff
* Switch to a TERM that exists if the one we're using doesn't
authorDon Armstrong <don@donarmstrong.com>
Tue, 25 Sep 2007 05:42:01 +0000 (05:42 +0000)
committerDon Armstrong <don@donarmstrong.com>
Tue, 25 Sep 2007 05:42:01 +0000 (05:42 +0000)
.bashrc

diff --git a/.bashrc b/.bashrc
index e0af9c23564be586bad131236caf407f8d2a016d..99e079c86000d2a7236cc1cd7be2822d862ee87b 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -35,6 +35,21 @@ if [ "$PS1" ]; then
     PS1="\[\033[0;36m\]\h \t \w$\[\033[0m\] "
     # \[\033[1;36m\][\w]\n\[\033[0;36m\][\h|\t]$ \[\033[0m\]
 
     PS1="\[\033[0;36m\]\h \t \w$\[\033[0m\] "
     # \[\033[1;36m\][\w]\n\[\033[0;36m\][\h|\t]$ \[\033[0m\]
 
+    # make sure the term we're using exists in the termcap
+    if ! toe -a|grep -q "^$TERM        "; then
+       # if it doesn't, try to switch
+       case $TERM in
+           rxvt*)
+               TERM="rxvt"
+               ;;
+           xterm*)
+               TERM="xterm"
+               ;;
+           *)
+               ;;
+       esac
+       export TERM;
+    fi;
     # If this is an xterm set the title to user@host:dir
     case $TERM in
        screen|xterm*)
     # If this is an xterm set the title to user@host:dir
     case $TERM in
        screen|xterm*)