]> git.donarmstrong.com Git - zsh.git/commitdiff
switch from rxvt to xterm if there's no termcap
authorDon Armstrong <don@donarmstrong.com>
Fri, 14 Apr 2017 17:16:47 +0000 (10:16 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 14 Apr 2017 17:16:47 +0000 (10:16 -0700)
.zsh/zshrc/10_switch_term [new file with mode: 0644]

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