From 7b9245e61c296ec01ec1d64d2077265c0c87cbfa Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Mon, 26 Jan 2015 21:43:09 +0100 Subject: [PATCH] Auto-select/deselect "xterm-256color" TERM setting --- sys/profile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/profile b/sys/profile index 1b27afc..4573228 100644 --- a/sys/profile +++ b/sys/profile @@ -40,6 +40,14 @@ fi # Clean up ... unset LC_CTYPE LC_encoding 2>/dev/null +# Fix TERM: +# Use "xterm-256color" for xterm's (and the like) when it is available +[ "$TERM" = "xterm" -a -r "/usr/share/terminfo/x/xterm+256color" ] \ + && export TERM="xterm-256color" +# Don't use "xterm-256color" when it is not available +[ "$TERM" = "xterm-256color" -a -r "/usr/share/terminfo/x/xterm+256color" ] \ + || export TERM="xterm" + # Initialize PATH variable if [ -x /usr/libexec/path_helper ]; then eval `/usr/libexec/path_helper -s \ -- 2.39.2