Prevent bash to source-bashrc-because-ssh when obviously non-interactive

See: https://www.gnu.org/software/bash/manual/html_node/Bash-Startup-Files.html

The bash "cleverness" applies even to deply nested `bash -c`, e.g direnv.
This commit is contained in:
Loic Nageleisen 2024-02-13 10:04:08 +01:00
parent fdb7fec9aa
commit d50534572d
Signed by: lloeki
GPG key ID: D05DAEE6889F94C2

View file

@ -1,5 +1,9 @@
## bashrc, called for interactive shells
if [[ $- != *i* ]]; then
return
fi
[[ -z "$DOTFILES_ROOT_DIR" ]] && source "$HOME/.dotfilesrc"
source $DOTFILES_SHELL_DIR/aliases