zsh: add compaudit to ensure completions are safe to load
This commit is contained in:
parent
4825a6d52f
commit
d23fedb47b
1 changed files with 17 additions and 4 deletions
19
.zshrc
19
.zshrc
|
@ -24,7 +24,7 @@ ${SKIP_PLUGINS:-false} || {
|
||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# }}")}' ' $((r-2))"'}
|
# }}")}' ' $((r-2))"'}|)}'""}| f%nfda@#$%^!@#$h&&f.fd
|
||||||
# ^^^^ syntax highlighting fix
|
# ^^^^ syntax highlighting fix
|
||||||
|
|
||||||
# Source zinit
|
# Source zinit
|
||||||
|
@ -212,10 +212,23 @@ export LESS_TERMCAP_us=$'\E[01;36m'
|
||||||
export LESS=-R
|
export LESS=-R
|
||||||
autoload -Uz compinit colors zcalc
|
autoload -Uz compinit colors zcalc
|
||||||
# only do full compinit once per day, use cached version usually
|
# only do full compinit once per day, use cached version usually
|
||||||
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
|
if ! compaudit &>/dev/null; then
|
||||||
compinit
|
echo "WARNING!"
|
||||||
|
echo " the following directories contain completions that have the wrong file permissions to be considered safe."
|
||||||
|
compaudit
|
||||||
|
echo " completions not loaded"
|
||||||
|
echo
|
||||||
|
echo "Please fix this and then continue"
|
||||||
|
echo " (note, this command might help: compaudit | xargs chmod g-w,o-w)"
|
||||||
|
echo
|
||||||
else
|
else
|
||||||
|
if ! [[ -o extendedglob ]]; then setopt extendedglob; undo_setopt=true; fi
|
||||||
|
if [[ -n ${ZDOTDIR}/.zcompdump(#qN.mh+24) ]]; then
|
||||||
|
compinit
|
||||||
|
else
|
||||||
compinit -C
|
compinit -C
|
||||||
|
fi
|
||||||
|
if [[ undo_setopt = true ]]; then unsetopt extendedglob; fi
|
||||||
fi
|
fi
|
||||||
colors
|
colors
|
||||||
# <<<
|
# <<<
|
||||||
|
|
Loading…
Add table
Reference in a new issue