mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-08 03:23:48 -05:00
update parent shell detection in pyenv-init to be more portable
This commit is contained in:
@@ -47,7 +47,11 @@ done
|
||||
|
||||
# If shell is not provided, detect it.
|
||||
if [ -z "$shell" ]; then
|
||||
shell="$(ps -p "$PPID" -o 'args=' 2>/dev/null || true)"
|
||||
if shell=$(tr '\0' ' ' 2>/dev/null </proc/"$PPID"/cmdline);then
|
||||
:
|
||||
else
|
||||
shell=$(ps p "$PPID" -o 'args=' 2>/dev/null || true)
|
||||
fi
|
||||
shell="${shell%% *}"
|
||||
shell="${shell##-}"
|
||||
shell="${shell:-$SHELL}"
|
||||
|
||||
Reference in New Issue
Block a user