]> git.donarmstrong.com Git - zsh.git/blob - .zsh/zshrc/10_switch_term
switch term if it is st-
[zsh.git] / .zsh / zshrc / 10_switch_term
1 # -*- mode: sh -*-
2 # zshrc/10_switch_term
3 #
4 # Switches from rxvt to xterm if the defined terminal does not exist
5
6 ## if this is a dump term, return without setting up anything
7 if [[ $TERM == "dumb" ]]; then
8     unsetopt zle
9     PS1='$ '
10     return
11 fi;
12
13
14 if [[ "$TERM" =~ "rxvt-" ]] && which tput >/dev/null 2>&1; then
15     if [[ -z "$(tput longname 2>/dev/null)" ]]; then
16         TERM="xterm-${TERM##rxvt-}"
17         export TERM
18     fi;
19 fi;
20 if [[ "$TERM" =~ "stterm-" ]] && which tput >/dev/null 2>&1; then
21     if [[ -z "$(tput longname 2>/dev/null)" ]]; then
22         TERM="xterm-${TERM##stterm-}"
23         export TERM
24     fi;
25 fi;
26 if [[ "$TERM" =~ "st-" ]] && which tput >/dev/null 2>&1; then
27     if [[ -z "$(tput longname 2>/dev/null)" ]]; then
28         TERM="xterm-${TERM##stterm-}"
29         export TERM
30     fi;
31 fi;
32
33 # vim:ft=zsh