[每当我启动iterm终端时。我总是收到此消息,并在终端上提示。
Last login: Fri May 1 21:33:59 on ttys001
[oh-my-zsh] plugin 'zsh-syntax-highlighting' not found
[oh-my-zsh] plugin 'zsh-autosuggestions' not found
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x 7 david admin 224 Apr 30 22:22 /usr/local/share/zsh
drwxrwxr-x 6 david admin 192 Apr 30 23:30 /usr/local/share/zsh/site-functions
[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.
~
➜
我该怎么办,以致它不会显示所有以上[oh-my-zsh]
消息,而我可以转到直接提示?设置[oh-my-zsh]
时我做错了什么?
似乎您正在尝试使用未安装的插件。请参阅以下有关如何安装它们的文档:
((基本上,您想将存储库克隆到$ZSH_CUSTOM/plugins
中并从.zshrc
中获取它们,但是请参阅每个文档的文档以供使用的实际命令。注意:zsh-syntax-highlighting
必须是最后一个来源的插件。] >)
问题的另一部分在终端输出中得到回答:
要修复您的权限,您可以通过禁用“组”和“其他”的写权限,并确保这些目录的所有者是root或您的当前用户来进行。
似乎所有者已经是您的当前用户,但是您的权限为
rwxrwxr-x
,对于用户和组,其权限为read, write, execute
,对于其他用户,权限为read, execute
。从警告消息中,您应该从组中删除写许可权:sudo chmod 755 zsh
现在ls -l
时,您将看到该目录的rwxr-xr-x
。对/usr/local/share/zsh/site-functions
目录执行相同的操作。
警告消息甚至为您提供了另一种选择,建议您将以下内容放入~/.zshrc
文件中并重新启动zsh:
ZSH_DISABLE_COMPFIX="true"