解决oh my zsh Insecure completion-dependent directories detected

安装oh my zsh 的命令

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"


--2021-09-01 15:44:32--  https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.108.133
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|151.101.108.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:8445 (8.2K) [text/plain]
正在保存至: “STDOUT”

100%[=================================================================>]   8.25K  --.-KB/s  用时 0s      

2021-09-01 15:45:09 (21.1 MB/s) - 已写入至标准输出 [8445/8445]

Cloning Oh My Zsh...
Cloning into '/Users/test/.oh-my-zsh'...
remote: Enumerating objects: 1140, done.
remote: Counting objects: 100% (1140/1140), done.
remote: Compressing objects: 100% (1103/1103), done.
remote: Total 1140 (delta 19), reused 1127 (delta 19), pack-reused 0
Receiving objects: 100% (1140/1140), 753.95 KiB | 17.00 KiB/s, done.
Resolving deltas: 100% (19/19), done.

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!


Please look over the ~/.zshrc file to select plugins, themes, and options.

p.s. Follow us on https://twitter.com/ohmyzsh

p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh

成功之后,打开新的终端后,会显示一些信息(以前安装的时候,没有这玩意):

[oh-my-zsh] For safety, we will not load completions from these directories until
[oh-my-zsh] you fix their permissions and ownership and restart zsh.
[oh-my-zsh] See the above list for directories with group or other writability.

[oh-my-zsh] To fix your permissions you can do so by disabling
[oh-my-zsh] the write permission of "group" and "others" and making sure that the
[oh-my-zsh] owner of these directories is either root or your current user.
[oh-my-zsh] The following command may help:
[oh-my-zsh]     compaudit | xargs chmod g-w,o-w

[oh-my-zsh] If the above didn't help or you want to skip the verification of
[oh-my-zsh] insecure directories you can set the variable ZSH_DISABLE_COMPFIX to
[oh-my-zsh] "true" before oh-my-zsh is sourced in your zshrc file.

所以要把这个信息屏蔽掉:
vim ~/.zshrc
文件第一行加入:
ZSH_DISABLE_COMPFIX="true" # 有的版本有引号, 有的版本无引号,自己尝试

保存之后,再执行命令:
source ~/.zshrc

猜你喜欢

转载自blog.csdn.net/weixin_43874301/article/details/120099334
今日推荐