X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.profile.d%2FTERM.bashrc;h=7294ab8f15f40578eece07db5aa2a5c8d4feddb2;hp=054e284b0ae2573ed4ad91c2f8d76db9460d4e05;hb=48f30af664cf57c765a763eea7c652da92d66c27;hpb=eae36419db72d287dc1af274027ab1c2d3d18dec diff --git a/.profile.d/TERM.bashrc b/.profile.d/TERM.bashrc index 054e284..7294ab8 100644 --- a/.profile.d/TERM.bashrc +++ b/.profile.d/TERM.bashrc @@ -1,29 +1,15 @@ -# $Id$ -# -# Try to find a valid TERM entry. -# +export TERMINFO=${PROFILE_HOME:-~}/.terminfo -# Note that running answerback will prevent keyboard input, which is annoying -# if you try to start typing while the shell is starting up. -term= -eval $(answerback 2>/dev/null) -case "$ANSWERBACK" in - PuTTY) term=xterm-256color;; - urxvt) term=rxvt-unicode;; -esac +# Cygwin MinTTY. +[ "$OS" = "Cygwin" -a "$TERM" = "xterm" ] && export TERM=putty-256color -if [ ! -z "$term" ]; then - if ! has_term $term; then - export TERMINFO=~/.terminfo - fi - export TERM=$term -elif ! has_term $TERM; then - for term in rxvt-unicode xterm-256color xterm-88color linux dtterm xterm-color xterm vt100; do - if has_term $term; then - export TERM=$term - break - fi - done -fi - -unset ANSWERBACK 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