每当我启动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]
时我做错什么了吗?
答案 0 :(得分:2)
您似乎正在尝试使用未安装的插件。有关如何安装它们,请参阅以下文档:
(基本上,您想将存储库克隆到$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"
答案 1 :(得分:0)
建议您将以下内容放入〜/ .zshrc文件中,然后重新启动zsh:
ZSH_DISABLE_COMPFIX="true"