每次打开新终端时,都会看到此内容,并且不知道如何解决

时间:2020-07-29 12:02:49

标签: zsh oh-my-zsh

我在MacBook Pro(2012年中)中使用MacOs Catalina 10.15.6。

我真的是编程新手,我不知道为什么在打开终端时总是出现这种情况:

Last login: Tue Jul 28 18:43:18 on ttys002
[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x  7 luigiminardi  admin  224 Jul 24 16:14 /usr/local/share/zsh
drwxrwxr-x  7 luigiminardi  admin  224 Jul 24 15:59 /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.

我在.zshrc中所做的所有修改都是这样:

# ASDF INSTALLED ON BREW
. $(brew --prefix asdf)/asdf.sh

之后:

# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#

但是我不知道它是否在正确的位置,或者这是否是导致问题的原因。

1 个答案:

答案 0 :(得分:1)

ZSH_DISABLE_COMPFIX=true之前的zshrc文件中设置$ZSH/oh-my-zsh.sh

这将跳过对不安全目录的验证:https://github.com/ohmyzsh/ohmyzsh/blob/master/lib/compfix.zsh

相关问题