Browse Source

Fix shell detection code to use upstream detection

Shell detection using $SHELL variable breaks in the case of
for example X sessions which are started with bash when the user
has a different shell session set. The fix applies the rbenv
code for shell detection which is more exhaustive.
pull/231/head
madumlao 8 years ago
parent
commit
ab64b81132
  1. 6
      libexec/jenv-init

6
libexec/jenv-init

@ -22,7 +22,11 @@ done @@ -22,7 +22,11 @@ done
shell="$1"
if [ -z "$shell" ]; then
shell="$(basename "$SHELL")"
shell="$(ps -p "$PPID" -o 'args=' 2>/dev/null || true)"
shell="${shell%% *}"
shell="${shell##-}"
shell="${shell:-$SHELL}"
shell="${shell##*/}"
fi
resolve_link() {

Loading…
Cancel
Save