diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh index a792127b29d..6cabf40594b 100644 --- a/share/spack/setup-env.sh +++ b/share/spack/setup-env.sh @@ -232,6 +232,10 @@ _spack_determine_shell() { # If procfs is present this seems a more reliable # way to detect the current shell _sp_exe=$(readlink /proc/$$/exe) + # Qemu emulation has _sp_exe point to the emulator + if [ "${_sp_exe##*qemu*}" != "${_sp_exe}" ]; then + _sp_exe=$(cat /proc/$$/comm) + fi # Shell may contain number, like zsh5 instead of zsh basename ${_sp_exe} | tr -d '0123456789' elif [ -n "${BASH:-}" ]; then