X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2FTERM.bashrc;h=7294ab8f15f40578eece07db5aa2a5c8d4feddb2;hp=a315c9fc4760b356c1fbaa66e7d0c41ad8927926;hb=48f30af664cf57c765a763eea7c652da92d66c27;hpb=a1c55a38fb1629ac6886b900f6de5083582d1b6b diff --git a/.profile.d/TERM.bashrc b/.profile.d/TERM.bashrc index a315c9f..7294ab8 100644 --- a/.profile.d/TERM.bashrc +++ b/.profile.d/TERM.bashrc @@ -1,2 +1,15 @@ -# $Id$ -export TERMINFO=~/.terminfo +export TERMINFO=${PROFILE_HOME:-~}/.terminfo + +# Cygwin MinTTY. +[ "$OS" = "Cygwin" -a "$TERM" = "xterm" ] && export TERM=putty-256color + +# 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