Comment 0 for bug 2020392

Revision history for this message
wentuq (wentuq) wrote :

I had a problem when I added custom path to my $PATH. I did, `export PATH="$HOME/bin:$PATH`, and added a secure_path in visudo. when I was using TAB completion, I neved could get TAB-completion for sudo <files in ~/bin>. Problem never existed in bash, there autocompletions works for $HOME/bin whenever its added to $PATH.
I discover that, it's because at least zsh-common_5.9-1_all/zsh-common_5.9-4_all/zsh-common_5.8.1-1_all

adds in /etc/zsh/zshrc
```
zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
                                           /usr/local/bin \
                                           /usr/sbin \
                                           /usr/bin \
                                           /sbin \
                                           /bin \
                                           zstyle ':completion:*:sudo:*' command-path /usr/local/sbin \
                                           /usr/local/bin \
                                           /usr/sbin \
                                           /usr/bin \
                                           /sbin \
                                           /bin \
                                           /usr/X11R6/bin

```
and overwrites the zsh defaults.
I think those lines should be removed completely, because the defaults are more sane and are consistent with bash. When removed mentioned zstyle, did `export PATH=$HOME/bin:$PATH` and did sudo<TAB>. It was working as expected.
I was just trying to append to my `$HOME/bin` to specified defaults but it can't be done, you have to overwrite those zstyle.

Beside it all, it was just quite hard, to know what is going, and what is overwriting really sane and working defaults.