From be2e606fbdbd8d129563a73a588e33e4fe350665 Mon Sep 17 00:00:00 2001 From: Jeff Kowalski Date: Thu, 6 Apr 2017 23:55:48 -0700 Subject: [PATCH] Prefer 'set' over 'setenv' for fish shell The setenv function in fish shell has changed dramatically in https://github.com/fish-shell/fish-shell/commit/75600b6b538f242a6b340e51965f25cfd4473c4a It now conforms to the csh version, which takes at most two arguments. In this init script, the form setenv PATH prepend_something $PATH had been used, which had too many arguments. Since setenv isn't a native command in fish, a suitable replacement is to use the "set -gx" command, which can consume multiple arguments. --- libexec/rbenv-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/rbenv-init b/libexec/rbenv-init index ac9d4cf..e8ae8d5 100755 --- a/libexec/rbenv-init +++ b/libexec/rbenv-init @@ -86,8 +86,8 @@ mkdir -p "${RBENV_ROOT}/"{shims,versions} case "$shell" in fish ) - echo "setenv PATH '${RBENV_ROOT}/shims' \$PATH" - echo "setenv RBENV_SHELL $shell" + echo 'set -gx PATH '${RBENV_ROOT}'/shims $PATH' + echo "set -gx RBENV_SHELL $shell" ;; * ) echo 'export PATH="'${RBENV_ROOT}'/shims:${PATH}"'