fix tcsh shell detection by looking at /proc/$PPID/exe instead of /proc/$PPID/cmdline

This commit is contained in:
Chris Ruvolo
2020-03-13 10:22:04 -04:00
parent b691fd3bf7
commit 443398fb8c

View File

@@ -1854,7 +1854,7 @@ detectshell () {
shell_type="BusyBox"
else
if [[ "${OSTYPE}" =~ "linux" ]]; then
shell_type=$(tr '\0' '\n' </proc/$PPID/cmdline | head -1)
shell_type=$(realpath /proc/$PPID/exe | awk -F'/' '{print $NF}')
elif [[ "${distro}" =~ "BSD" ]]; then
shell_type=$(ps -p $PPID -o command | tail -1)
else