054e284b0ae2573ed4ad91c2f8d76db9460d4e05
[profile.git] / .profile.d / TERM.bashrc
1 # $Id$
2 #
3 # Try to find a valid TERM entry.
4 #
5
6 # Note that running answerback will prevent keyboard input, which is annoying 
7 # if you try to start typing while the shell is starting up.
8 term=
9 eval $(answerback 2>/dev/null)
10 case "$ANSWERBACK" in
11   PuTTY) term=xterm-256color;;
12   urxvt) term=rxvt-unicode;;
13 esac
14
15 if [ ! -z "$term" ]; then
16   if ! has_term $term; then
17     export TERMINFO=~/.terminfo
18   fi
19   export TERM=$term
20 elif ! has_term $TERM; then
21   for term in rxvt-unicode xterm-256color xterm-88color linux dtterm xterm-color xterm vt100; do
22     if has_term $term; then
23       export TERM=$term
24       break
25     fi
26   done
27 fi
28
29 unset ANSWERBACK term