]> git.donarmstrong.com Git - zsh.git/blobdiff - .zsh/zshrc/10_switch_term
switch from rxvt to xterm if there's no termcap
[zsh.git] / .zsh / zshrc / 10_switch_term
diff --git a/.zsh/zshrc/10_switch_term b/.zsh/zshrc/10_switch_term
new file mode 100644 (file)
index 0000000..03406b0
--- /dev/null
@@ -0,0 +1,13 @@
+# -*- mode: sh -*-
+# zshrc/10_switch_term
+#
+# Switches from rxvt to xterm if the defined terminal does not exist
+
+if [[ "$TERM" == "rxvt-" ]] && which tput >/dev/null 2>&1; then
+    if [[ -z "$(tput longname 2>/dev/null)" ]]; then
+        TERM="xterm-${TERM##rxvt-}"
+        export TERM
+    fi;
+fi;
+
+# vim:ft=zsh