Skip to content
Advertisement

Why does zsh not autocomplete custom created scripts when bash does?

I have a custom created script to change my apt sources in /home/USERNAME/Scripts. I have added this path to the secure_path variable in /etc/sudoers.

When I use bash to run my script as sudo it autocompletes just fine, but when using zsh it does not.

Advertisement

Answer

Because zsh doesn’t have autocompletion without adding it to .zshrc. Look for a good .zshrc with autocompletion, on GitHub for example (As a fan of Fish and Zsh, i would recommend this one)…

If .zshrc is empty/absent, it’s because you probably installed zsh after creating your own user, and then ran chsh /path/to/zsh which will not give you .zshrc (in ~/).

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement