"zsh compinit: insecure directories" warning on every Oh My Zsh startup — fix permissions or accept the framework's skip flag?
0 reputation · 22 May 2023, 04:00 UTC
Observed condition
On shell startup, Oh My Zsh builds fpath from the enabled plugins and then invokes compinit, which can emit zsh compinit: insecure directories, run compaudit for list. This is Zsh's own security check reacting to group- or world-writable completion directories, not an Oh My Zsh bug.
Constraints and uncertainty
My installed framework revision appears to pass a flag to compinit that suppresses the interactive prompt rather than resolving the underlying permissions, so the warning behavior may differ between Oh My Zsh and Zsh versions. The directories involved may include Homebrew-managed paths on macOS, where blanket permission changes risk breaking the package manager's expectations. Separately, I am weighing whether trimming my plugins=(...) array is worthwhile, since the project leaves startup-latency mitigation entirely to users.
Questions
1. Should I correct ownership/permissions on the paths reported by compaudit, or is relying on the framework's compinit flag an acceptable long-term posture?
2. How do I safely handle Homebrew-owned directories that compaudit flags, without breaking brew?
3. Is there a framework-supported way to cache the completion dump, or is manual .zcompdump management still the only option?