Zsh detects insecure completion-dependent directories

30,519

Solution 1

This is an issue with ZSH, your shell, not Hyper, your terminal. I actually had the same issue earlier today. There are some solutions in this issue on Github, and I will quote some of them here but I recommend you follow the link and read the comments there.

The first solution is to change the ownership of the problematic directories.

I will not recommend this without knowing more about your environment, but for most people this will fix the issue:

chmod 755 /usr/local/share/zsh
chmod 755 /usr/local/share/zsh/site-functions

The second solution is to set ZSH_DISABLE_COMPFIX=true (or "true" in quotes) in your .zshrc file, to tell ZSH to not check for insecure directories.

The third solution, and the solution that fixed the issue for me, is to initialise compinit with the -u flag. This will use all the directories found by compaudit without checking them for security issues. To do this, you will have to change your .zshrc file or wherever you are configuring autocomplete.

Solution 2

On my mac, what helped was running brew doctor

The program told me the exact commands to run!

Share:
30,519
MetalFingers
Author by

MetalFingers

Updated on February 14, 2022

Comments

  • MetalFingers
    MetalFingers about 2 years

    I get the following error messages when I open my terminal, Hyper:

    [oh-my-zsh] Insecure completion-dependent directories detected:
    drwxrwxr-x  7 dwaynethe2nd  admin  224 Apr 25 15:00 /usr/local/share/zsh
    drwxrwxr-x  4 dwaynethe2nd  admin  128 Apr 25 14:53 /usr/local/share/zsh/site-functions
    
  • Paul Solt
    Paul Solt over 3 years
    I used the command the error message recommended to remove the write permissions for group and others. I think it's just asking to lock it down more, but it's not a clear error message. compaudit | xargs chmod g-w,o-w
  • runar
    runar over 3 years
    @SalahAdDin: Have you tried all three solutions? Do you see any error messages or any other information you would like to share? For the record, it worked for me and I'm using macOS Catalina myself.
  • SalahAdDin
    SalahAdDin over 3 years
    I disabled that zsh feature.
  • Mick McCarthy
    Mick McCarthy about 3 years
    Hey I know this is an old-ish post but after running the chmod 755..., ZSH takes an absolute age to load up after opening the terminal...any idea what this might be?
  • Aisuko
    Aisuko almost 3 years
    Hi guys, I have two accounts in the macOS. So, we shouldn't use the first solution. And the second solution does not make sense we all know. The third solution, I always get the permission issue with my standard user(the folder own of admin account)
  • Ashish Gupta
    Ashish Gupta almost 3 years
    Hi, this might be coming late but can someone explain what this warning error exactly means? OMZ seems to have added the above solutions as reference for fixing this error but I want to understand what exactly am I solving here. Thanks!
  • Tom Kelly
    Tom Kelly over 2 years
    @AshishGupta It means you do not have the appropriate file permissions for these directories. Another solution is chown $USER /usr/local/share/zsh.
  • Raydot
    Raydot about 2 years
    Just so as not to confuse anyone: if you've never installed or heard of Homebrew, this solution and the one just above are not your problem.