From c91d299887d93d6e8940b80442bf6c2f10fe6a64 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 5 Aug 2022 12:30:29 +0300 Subject: Added a lot of untracked files and updated other files --- .zsh/omz/compfix.zsh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .zsh/omz/compfix.zsh (limited to '.zsh/omz/compfix.zsh') diff --git a/.zsh/omz/compfix.zsh b/.zsh/omz/compfix.zsh new file mode 100644 index 0000000..290760e --- /dev/null +++ b/.zsh/omz/compfix.zsh @@ -0,0 +1,40 @@ +# Handle completions insecurities (i.e., completion-dependent directories with +# insecure ownership or permissions) by: +# +# * Human-readably notifying the user of these insecurities. +function handle_completion_insecurities() { + # List of the absolute paths of all unique insecure directories, split on + # newline from compaudit()'s output resembling: + # + # There are insecure directories: + # /usr/share/zsh/site-functions + # /usr/share/zsh/5.0.6/functions + # /usr/share/zsh + # /usr/share/zsh/5.0.6 + # + # Since the ignorable first line is printed to stderr and thus not captured, + # stderr is squelched to prevent this output from leaking to the user. + local -aU insecure_dirs + insecure_dirs=( ${(f@):-"$(compaudit 2>/dev/null)"} ) + + # If no such directories exist, get us out of here. + [[ -z "${insecure_dirs}" ]] && return + + # List ownership and permissions of all insecure directories. + print "[oh-my-zsh] Insecure completion-dependent directories detected:" + ls -ld "${(@)insecure_dirs}" + + cat <