From cb55161470e051e520bad388c20e32d43cfca973 Mon Sep 17 00:00:00 2001 From: leycec Date: Tue, 12 May 2015 19:27:51 -0400 Subject: Completion insecurities handled on startup. Completion-dependent directories with insecure permissions or ownership (e.g., group or other writability) are now detected, reported, and sanitized on OMZ startup rather than unsafely ignored -- which resulted in effectively empty completion caches and obscure compdef() errors resembling "compdef: unknown command or service: git". This fixes long-standing issues #630, #3356, and #3455 and related Babun issues 159, 281, and 322 -- and probably numerous other duplicates. --- oh-my-zsh.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index ec64c240f..9dde78caa 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -8,6 +8,9 @@ fi # add a function path fpath=($ZSH/functions $ZSH/completions $fpath) +# Load all stock functions (from $fpath files) called below. +autoload -U compaudit compinit + # Set ZSH_CUSTOM to the path where your custom config files # and plugins exists, or else we will use the default custom/ if [[ -z "$ZSH_CUSTOM" ]]; then @@ -64,9 +67,14 @@ if [ -z "$ZSH_COMPDUMP" ]; then ZSH_COMPDUMP="${ZDOTDIR:-${HOME}}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" fi -# Load and run compinit -autoload -U compinit -compinit -i -d "${ZSH_COMPDUMP}" +# If completion insecurities exist, warn the user without enabling completions. +if ! compaudit &>/dev/null; then + # This function resides in the "lib/compfix.zsh" script sourced above. + handle_completion_insecurities +# Else, enable and cache completions to the desired file. +else + compinit -d "${ZSH_COMPDUMP}" +fi # Load all of the plugins that were defined in ~/.zshrc for plugin ($plugins); do -- cgit v1.2.3-70-g09d2 From 3fe3ce8bdc702d7e40917bf677b0dc34211e0a55 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sat, 8 Aug 2015 01:31:02 +0200 Subject: Revert "Move custon *.zsh file sourcing up so that they can load plugins and other things that come after." This reverts commit a28dbc83937cbe624ec726199b4bbe7b65b2b2a0. --- oh-my-zsh.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'oh-my-zsh.sh') diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index ec64c240f..4e5f77990 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -29,11 +29,6 @@ for config_file ($ZSH/lib/*.zsh); do source $config_file done -# Load all of your custom configurations from custom/ -for config_file ($ZSH_CUSTOM/*.zsh(N)); do - source $config_file -done -unset config_file is_plugin() { local base_dir=$1 @@ -77,6 +72,12 @@ for plugin ($plugins); do fi done +# Load all of your custom configurations from custom/ +for config_file ($ZSH_CUSTOM/*.zsh(N)); do + source $config_file +done +unset config_file + # Load the theme if [ "$ZSH_THEME" = "random" ]; then themes=($ZSH/themes/*zsh-theme) -- cgit v1.2.3-70-g09d2