1
0
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:
rockandska
2025-09-09 10:38:11 +02:00
parent 0d987b0e4b
commit 68edd564cf

View File

@@ -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}"