ohmyzsh: compdef: unknown command or service: git

This was previously referenced in #630 a solution was proposed here: https://github.com/robbyrussell/oh-my-zsh/issues/630#issuecomment-26227872 but the solution doesn’t work

when .zshrc executes

source $ZSH/oh-my-zsh.sh

it fails to complete execution of the initialization, throws the error, and bloxks shell initialization, which prevents things like autocomplete

running

compaudit | sudo xargs chmod g-w
compaudit | sudo xargs chown root
rm ~/.zcompdump*
compinit

fails to fix the unsecure folders problem, and when I run compaudit I receive the following:

There are insecure directories:
/usr/local/share/zsh/site-functions
/usr/local/Cellar/zsh/5.0.7/share/zsh/functions
/usr/local/share/zsh
/usr/local/Cellar/zsh/5.0.7/share/zsh

adding a call to compinit finishes the shell initialization (autocomplete works again), but I’d like to know how to fix the error output that appears on every terminal session load

for reference: I’m using brew-installed zsh 5.0.7 (x86_64-apple-darwin13.4.0)

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 19

Commits related to this issue

Most upvoted comments

@jmtatsch Try running these commands, you can remove the # comments or just paste them in, your shell should ignore them and not try to run those lines.

#This will perform chmod g-w for each file returned by compaudit to remove write access for group
compaudit | xargs -I % chmod g-w "%"
#This will perform chown to current user (Windows and Linux) for each file returned by compaudit
compaudit | xargs -I % chown $USER "%"
#Remove all dump files (which normally speed up initialization)
rm ~/.zcompdump*
#Regenerate completions file
compinit