X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2FTERM.bashrc;h=7294ab8f15f40578eece07db5aa2a5c8d4feddb2;hp=5bb800c3c4e56a07e223cc69093e84d20bf5e015;hb=48f30af664cf57c765a763eea7c652da92d66c27;hpb=f00d519dd073659e3a079be65c57d5b64cb60a69 diff --git a/.profile.d/TERM.bashrc b/.profile.d/TERM.bashrc index 5bb800c..7294ab8 100644 --- a/.profile.d/TERM.bashrc +++ b/.profile.d/TERM.bashrc @@ -1 +1,15 @@ 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