From 811ca05916ad5cef5b26dec661b0906d126dd770 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Fri, 28 Dec 2012 10:59:10 -0600 Subject: [PATCH] Run `hash -r` after `rbenv rehash` when shell integration is enabled Fixes #119 --- libexec/rbenv-sh-rehash | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 libexec/rbenv-sh-rehash diff --git a/libexec/rbenv-sh-rehash b/libexec/rbenv-sh-rehash new file mode 100755 index 00000000..9cc75265 --- /dev/null +++ b/libexec/rbenv-sh-rehash @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -e +[ -n "$RBENV_DEBUG" ] && set -x + +# Provide rbenv completions +if [ "$1" = "--complete" ]; then + exec rbenv-rehash --complete +fi + +# When rbenv shell integration is enabled, delegate to rbenv-rehash, +# then tell the shell to empty its command lookup cache. +rbenv-rehash +echo "hash -r"