Zsh Compaudit

This is more or less a note-to-self.

Note: this doesn’t seem to be the simplest solution. See edit from 27th June 2021 below.

If ZSH’s compaudit complains about insecure directories on a Mac, removing write permissions will fix the issue (see this SO answer):

chmod g-w ${insecure-directories}

In case this doesn’t work (for example if you have permission clashes with tools which use the same directories as ZSH—e.g. Brew), you can also choose to ignore insecure directory warnings by adding the following to the front of ~/.zshrc

autoload -Uz compinit && compinit -i > /dev/null

The -i flag will tell ZSH to ignore insecure directories. Note that since compinit will output utility functions we redirect the output of compinit -i to /dev/null.

Edit (28th June 2021): The simplest solution to deal with the warnings/errors created by zsh is to silence compinit. You can do this by putting


before compinit is being called. If you use oh-my-zsh, ZSH_DISABLE_COMPFIX has to be set before sourcing oh-my-zsh.sh like so:

source $ZSH/oh-my-zsh.sh