每当我打开 iterm 终端时,如何避免显示一堆“[oh-my-zsh]”消息?

How to avoid bunch of "[oh-my-zsh]" messages showing whenever I open iterm terminal?

每当我启动我的 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] 时做错了什么吗?

您似乎在尝试使用尚未安装的插件。请参阅以下有关如何安装它们的文档:

(基本上你想将 repos 克隆到 $ZSH_CUSTOM/plugins 并在你的 .zshrc 中获取它们,但请参阅每个文档以了解要使用的实际命令。注意:zsh-syntax-highlighting 必须是最后一个插件。)


您的问题的另一部分已在您的终端输出中得到解答:

To fix your permissions you can do so by disabling the write permission of "group" and "others" and making sure that the owner of these directories is either root or your current user.

看起来所有者已经是您当前的用户,但是您的权限是 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"

建议您将以下内容放入 ~/.zshrc 文件并重新启动 zsh:

ZSH_DISABLE_COMPFIX="true"