From e0dfc3ddbf4bc92ddf206cbc3e55ace32928c174 Mon Sep 17 00:00:00 2001
From: "Adam J. Stewart" <ajstewart426@gmail.com>
Date: Thu, 13 Feb 2020 20:07:09 -0600
Subject: [PATCH] Fix shell detection: zsh5 -> zsh (#14858)

---
 share/spack/setup-env.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/share/spack/setup-env.sh b/share/spack/setup-env.sh
index 207e9c4a80..c3d9ef260c 100755
--- a/share/spack/setup-env.sh
+++ b/share/spack/setup-env.sh
@@ -212,7 +212,8 @@ _spack_determine_shell() {
         # If procfs is present this seems a more reliable
         # way to detect the current shell
         _sp_exe=$(readlink /proc/$$/exe)
-        basename ${_sp_exe}
+        # Shell may contain number, like zsh5 instead of zsh
+        basename ${_sp_exe} | tr -d '0123456789'
     elif [ -n "${BASH:-}" ]; then
         echo bash
     elif [ -n "${ZSH_NAME:-}" ]; then
-- 
GitLab