mirror of
https://github.com/pyenv/pyenv.git
synced 2025-12-08 15:31:26 +09: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…
x
Reference in New Issue
Block a user