【问题标题】:How to avoid bunch of "[oh-my-zsh]" messages showing whenever I open iterm terminal?每当我打开 iterm 终端时,如何避免显示一堆“[oh-my-zsh]”消息?
【发布时间】:2020-05-02 04:43:00
【问题描述】:

每当我启动 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 iterm2 oh-my-zsh


    【解决方案1】:

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

    (基本上你想将 repos 克隆到 $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"
    

    【讨论】:

      【解决方案2】:

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

      ZSH_DISABLE_COMPFIX="true"

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-12-02
        • 1970-01-01
        • 2018-12-02
        • 1970-01-01
        • 1970-01-01
        • 2015-12-23
        相关资源
        最近更新 更多