From 75a8978a0a52f9d8f727d184b86325e1aad037d9 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 28 May 2020 18:06:54 +0200 Subject: [PATCH] [bash] Fix sourcing of xdg vars and terminfo Fixed setting up the initial variable pointing to the xdg directory to enable bash to source its files from the `.config environment` --- home/.bash_profile | 3 +++ sh/.config/sh/env | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/home/.bash_profile b/home/.bash_profile index f724702..c6c4f2a 100644 --- a/home/.bash_profile +++ b/home/.bash_profile @@ -4,6 +4,9 @@ # # shellcheck disable=SC1090 +# ensure bash is set up for its initial sourcing +export XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-"$HOME/.config"} + # load global sh env vars [ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env" if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then diff --git a/sh/.config/sh/env b/sh/.config/sh/env index a1210e3..b2fd712 100644 --- a/sh/.config/sh/env +++ b/sh/.config/sh/env @@ -43,4 +43,6 @@ export LANG="en_US.UTF-8" 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 +if [ "$(find /usr/share/terminfo -name "$TERMINAL*" | wc -l)" -eq 0 ] || [ -z "$TERMINAL" ]; then + export TERM=xterm +fi