summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rwxr-xr-xshare/spack/setup-env.sh9
1 files changed, 6 insertions, 3 deletions
diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index d5cad059a6..ab2655ddf6 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -215,11 +215,14 @@ _spack_pathadd() {
}
-#
# Determine which shell is being used
-#
_spack_determine_shell() {
- if [ -n "${BASH:-}" ]; then
+ if [ -f "/proc/$$/exe" ]; then
+ # If procfs is present this seems a more reliable
+ # way to detect the current shell
+ _sp_exe=$(readlink /proc/$$/exe)
+ basename ${_sp_exe}
+ elif [ -n "${BASH:-}" ]; then
echo bash
elif [ -n "${ZSH_NAME:-}" ]; then
echo zsh