From 2429955bc09778b8b4129f93939a05bf533d378d Mon Sep 17 00:00:00 2001 From: Quinn Date: Mon, 12 Jan 2026 15:18:06 +0100 Subject: [PATCH] Rework sourcing of .bashrc --- .profile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.profile b/.profile index 453f839..5218209 100644 --- a/.profile +++ b/.profile @@ -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"