mirror of
https://github.com/pyenv/pyenv.git
synced 2026-09-10 07:36:16 -04:00
update parent shell detection in pyenv-init to be more portable
This commit is contained in:
parent
0d987b0e4b
commit
68edd564cf
|
|
@ -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}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue