agkozak/zsh-z

`ZSHZ[CHOWN,RM,MV]` aren't set when user loads zsh/files early

Closed this issue · 2 comments

z0rc commented

In my rc files I load zsh/files early to use for other things I do in rc files. Initialization is done via zmodload -F -m zsh/files b:zf_\*. zsh-z plugin is sourced afterwards.

This situation breaks conditional logic at

zsh-z/zsh-z.plugin.zsh

Lines 108 to 121 in 5780313

# Load zsh/files, if necessary and if available (MobaXterm zsh lacks zsh/files)
if [[ ! ${builtins[zf_chown]} == 'defined' ||
! ${builtins[zf_mv]} == 'defined' ||
! ${builtins[zf_rm]} == 'defined' ]]; then
if zmodload -F zsh/files b:zf_chown b:zf_mv b:zf_rm &> /dev/null; then
ZSHZ[CHOWN]='zf_chown'
ZSHZ[MV]='zf_mv'
ZSHZ[RM]='zf_rm'
else
ZSHZ[CHOWN]='chown'
ZSHZ[MV]='mv'
ZSHZ[RM]='rm'
fi
fi
resulting in keys ZSHZ[CHOWN], ZSHZ[RM] and ZSHZ[MV] being unset, which breaks a lot of things in plugin. Each check of ! ${builtins[zf_...]} == 'defined' is false, which skips assignment of keys to ZSHZ

Thanks for reporting this problem. I'll look into it later today.

OK, I just pushed changes to the master branch that should fix your problem. Thanks for reporting it.