X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2FTERM.bashrc;h=7294ab8f15f40578eece07db5aa2a5c8d4feddb2;hb=210a297d59649b72776feaae4b318945f7ad4074;hp=f9132c0cf0c2984d1659b3ac97346ffc2c12c26f;hpb=104b025d33b8cf5f9d42bda3ac3d158eb7a07701;p=profile.git diff --git a/.profile.d/TERM.bashrc b/.profile.d/TERM.bashrc index f9132c0..7294ab8 100644 --- a/.profile.d/TERM.bashrc +++ b/.profile.d/TERM.bashrc @@ -1,13 +1,15 @@ -# $Id$ -# -# Try to find a valid TERM entry. -# +export TERMINFO=${PROFILE_HOME:-~}/.terminfo -for term in linux dtterm xterm vt100; do - if has_term $term; then - export TERM=$term - break - fi -done +# Cygwin MinTTY. +[ "$OS" = "Cygwin" -a "$TERM" = "xterm" ] && export TERM=putty-256color -unset term +# Check the terminal is valid. +while [ -z "$(tput longname 2>/dev/null)" ]; do + case $TERM in + xterm-256color) export TERM=xterm-88color;; + xterm-88color) export TERM=xterm-color;; + xterm-color) export TERM=xterm;; + xterm) break;; + *) export TERM=xterm-256color;; + esac +done