Only set up environment for top-level shells, and allow it to be inherited normally. Top level shells are usually login shells, but can also be non-interactive non-login shells in certain cases, such as when executing an ssh remote command.
12 lines
225 B
Bash
12 lines
225 B
Bash
#
|
|
# Defines environment variables.
|
|
#
|
|
# Authors:
|
|
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
|
#
|
|
|
|
# Treat top-level shells as "login" shells.
|
|
if [[ $SHLVL == 1 && ! -o LOGIN ]]; then
|
|
source "${ZDOTDIR:-$HOME}/.zprofile"
|
|
fi
|
|
|