Rework sourcing of .bashrc

This commit is contained in:
2026-01-12 15:18:06 +01:00
parent 327dc0f673
commit 2429955bc0

View File

@@ -43,11 +43,11 @@ export GCC_COLORS=auto
ssh-add "$HOME/.ssh/admin@homeserver" >/dev/null 2>&1
}
# if executing interactively
# execute .bashrc in the current login context
case $- in
*i*) ;;
*) return ;;
esac
[ -z "${PS1-}" ] && return
[ -f "$HOME/.bashrc" ] && . "$HOME/.bashrc"
#shellcheck disable=SC1091
# Source ~/.bashrc, when in interactive mode, but not POSIX/sh mode.
[ "$BASH" ] &&
[ "$PS1" ] &&
[ -z "$POSIXLY_CORRECT" ] &&
[ "${0#-}" != 'sh' ] &&
[ -r "$HOME/.bashrc" ] &&
. "$HOME/.bashrc"