Created
October 20, 2010 17:26
-
-
Save changemewtf/636883 to your computer and use it in GitHub Desktop.
Sets your $TERM to 256color if the termcap entry exists. Particularly useful for gnome-terminal, which has no option to set $TERM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case "$TERM" in | |
*-256color) | |
alias ssh='TERM=${TERM%-256color} ssh' | |
;; | |
*) | |
POTENTIAL_TERM=$TERM-256color | |
POTENTIAL_TERMINFO=${TERM:0:1}/$POTENTIAL_TERM | |
BOX_TERMINFO_DIR=/usr/share/terminfo | |
[[ -f $BOX_TERMINFO_DIR/$POTENTIAL_TERMINFO ]] && export TERM=$POTENTIAL_TERM | |
HOME_TERMINFO_DIR=$HOME/.terminfo | |
[[ -f $HOME_TERMINFO_DIR/$POTENTIAL_TERMINFO ]] && export TERM=$POTENTIAL_TERM | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment