Default path for sudo TAB completion

Bug #2020392 reported by wentuq
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zsh (Ubuntu)
New
Undecided
Unassigned

Bug Description

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 on, and what is overwriting really sane and working defaults.

wentuq (wentuq)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.