From 43ba5d2b5c07ff597985ce0006ff8acfa33436c2 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Tue, 31 Dec 2019 12:10:05 +0100 Subject: [PATCH] Improve detection of xterm-256color and remove xterm+256color again --- .znewterm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.znewterm b/.znewterm index 944a661..038cbc9 100644 --- a/.znewterm +++ b/.znewterm @@ -23,20 +23,23 @@ then stty erase  fi -if [[ $TERM == xterm-256color && ! -f /usr/share/terminfo/x/xterm-256color ]] +if [[ $TERM == xterm-256color && ! -f /usr/share/terminfo/x/xterm-256color && ! -f /lib/terminfo/x/xterm-256color ]] then TERM=xterm fi if [[ $TERM == xterm ]] then - for t in xterm-256color xterm+256color + for t in xterm-256color do - if [[ -f /usr/share/terminfo/x/$t ]] - then - TERM=$t - break - fi + for d in /usr/share/terminfo/x /lib/terminfo/x + do + if [[ -f $d/$t ]] + then + TERM=$t + break + fi + done done fi @@ -57,7 +60,7 @@ case "$TERM" in ;; esac -if [[ $TERM = xterm || $TERM = xterm-256color || $TERM = xterm+256color ]] +if [[ $TERM = xterm || $TERM = xterm-256color ]] then if [ -f ~/.zxtermcolors ] then