From 3a40925615ca8622d98859a642f6b9f9d431a51c Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 28 May 2020 14:22:31 +0200 Subject: [PATCH] [sh] Default TERM to xterm if no terminfo exists --- sh/.config/sh/env | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sh/.config/sh/env b/sh/.config/sh/env index a555ab4..a1210e3 100644 --- a/sh/.config/sh/env +++ b/sh/.config/sh/env @@ -13,9 +13,6 @@ export PATH="$PATH:$XDG_BIN_HOME" ## BEGIN GLOBAL ENV VARS ## ############################### -# if we forgot to set it treat bash as default -export SHELL=${SHELL:-/bin/bash} - # will be picked up by many programs as notes directory export WIKIROOT="${WIKIROOT:-$HOME/documents/notes}" # will be picked up by many programs as library root directory @@ -41,3 +38,9 @@ export PATH="$PATH:$GOPATH/bin" ## LANG LOCALE UTF-8 export LC_ALL="en_US.UTF-8" export LANG="en_US.UTF-8" + +# if we forgot to set it treat bash as default +export SHELL=${SHELL:-/bin/bash} + +# if terminfo for our terminal emulator does not exist fall back to xterm +[ "$(find /usr/share/terminfo -name "$TERMINAL*" | wc -l)" -eq 0 ] && export TERM=xterm