mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-11 04:53:47 -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 shell is not provided, detect it.
|
||||||
if [ -z "$shell" ]; then
|
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="${shell##-}"
|
||||||
shell="${shell:-$SHELL}"
|
shell="${shell:-$SHELL}"
|
||||||
|
|||||||
Reference in New Issue
Block a user