解决oh my zsh Insecure completion-dependent directories detected

安装oh my zsh 的命令

sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"


--2020-04-10 15:44:32--  https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh
正在解析主机 raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.108.133
正在连接 raw.githubusercontent.com (raw.githubusercontent.com)|151.101.108.133|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:8445 (8.2K) [text/plain]
正在保存至: “STDOUT”

100%[=================================================================>]   8.25K  --.-KB/s  用时 0s      

2020-04-10 15:45:09 (21.1 MB/s) - 已写入至标准输出 [8445/8445]

Cloning Oh My Zsh...
Cloning into '/Users/zhl/.oh-my-zsh'...
remote: Enumerating objects: 1140, done.
remote: Counting objects: 100% (1140/1140), done.
remote: Compressing objects: 100% (1103/1103), done.
remote: Total 1140 (delta 19), reused 1127 (delta 19), pack-reused 0
Receiving objects: 100% (1140/1140), 753.95 KiB | 17.00 KiB/s, done.
Resolving deltas: 100% (19/19), done.

Looking for an existing zsh config...
Using the Oh My Zsh template file and adding it to ~/.zshrc.

         __                                     __
  ____  / /_     ____ ___  __  __   ____  _____/ /_
 / __ \/ __ \   / __ `__ \/ / / /  /_  / / ___/ __ \
/ /_/ / / / /  / / / / / / /_/ /    / /_(__  ) / / /
\____/_/ /_/  /_/ /_/ /_/\__, /    /___/____/_/ /_/
                        /____/                       ....is now installed!


Please look over the ~/.zshrc file to select plugins, themes, and options.

p.s. Follow us on https://twitter.com/ohmyzsh

p.p.s. Get stickers, shirts, and coffee mugs at https://shop.planetargon.com/collections/oh-my-zsh

成功之后,打开新的终端后,会显示一些信息(以前安装的时候,没有这玩意):

[oh-my-zsh] Insecure completion-dependent directories detected:
drwxrwxr-x  3 zhangli53  admin  96  4  8 12:12 /usr/local/share/zsh
drwxrwxr-x  2 zhangli53  admin  64  4  8 12:12 /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.

所以要把这个信息屏蔽掉:

vim ~/.zshrc

文件第一行加入:

ZSH_DISABLE_COMPFIX="true"    # 有的版本有引号, 有的版本无引号,自己尝试

保存之后,再执行命令:

source ~/.zshrc   # 原封不动的执行这条命令就ok了,再开新终端就生效了
  • 7
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
oh-my-zsh 是一个开源的、社区驱动的 zsh 配置管理框架,它提供了一系列的插件、主题和自定义选项,使得用户可以轻松地定制和管理自己的 zsh 终端环境。它旨在提供一个更强大、更易用的终端工具。 而 oh-my-zsh-git 是 oh-my-zsh 在 GitHub 上的一个 fork 版本,它基于原版的 oh-my-zsh,对其进行了一些修改和扩展。oh-my-zsh-git 主要的目的是为了扩展和增强原版 oh-my-zsh 的功能,并从社区中收集和整合更多的插件和主题。 具体来说,oh-my-zsh-git 与 oh-my-zsh 的区别主要体现在以下几个方面: 1. 功能扩展:oh-my-zsh-git 在原版 oh-my-zsh 的基础上增加了一些功能和工具,使得终端使用起来更加方便和高效。 2. 插件和主题:oh-my-zsh-git 提供了更多的插件和主题选项,且会持续更新和增加。用户可以根据自己的需求选择和使用不同的插件和主题。 3. 扩展性:oh-my-zsh-git 更加注重可扩展性,用户可以自定义添加新的插件和主题,或者根据自己的需要修改现有的插件和主题。 4. 社区支持:oh-my-zsh-git 的社区活跃度较高,用户能够得到更多的帮助和支持,同时也能够贡献自己的代码和改进。 综上所述,oh-my-zsh-git 是在 oh-my-zsh 基础上进行的一些改进和扩展,提供了更多的插件和主题选项,同时注重用户的自定义和扩展能力。用户可以根据自己的需求选择采用哪个版本。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值