Browse files

Fixes issue 199

Fixes issue 199 where the bash completion was not working in ZSH
because the builtin bash command `complete` was not found. The fix
executes the `bashcompinit` command which creates the `complete`
function for the Z shell.
  • Loading branch information...
1 parent 0ec339e commit 205117bed46a31a5dbde56b659720f2ecfe306ee @croach croach committed Mar 1, 2013
Showing with 7 additions and 0 deletions.
  1. +7 −0 bash_completion
@@ -79,4 +79,11 @@ __nvm ()
return 0
+# complete is a bash builtin, but recent versions of ZSH come with a function
+# called bashcompinit that will create a complete in ZSH. If the user is in
+# ZSH, load and run bashcompinit before calling the complete function.
+if [[ -n ${ZSH_VERSION-} ]]; then
+ autoload -U +X bashcompinit && bashcompinit
complete -o default -o nospace -F __nvm nvm

0 comments on commit 205117b

Please sign in to comment.