setup-env.sh: if exe contains qemu, use /proc/$$/comm instead

This commit is contained in:
Wouter Deconinck 2023-12-14 20:07:27 -06:00
parent 8ba4b3c103
commit 4bd0276ab0

View File

@ -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