3

System:

I'm running Ubuntu 16.10 with ZFS and ZSH installed.

Expected behaviour:

As the root user, I can press tab to autocomplete zfs commands and paths. It works both in zsh and bash. As a non-root user, I can do so in bash. It works like this:

# zfs snapshot poTab# zfs snapshot pool

Actual behaviour in zsh:

While it always works fine in bash, the non-root user (which is in the sudo group) can not tab complete in zsh. I get a permission error like this:

$ sudo zfs snapshot poTab

$ sudo zfs snapshot poPermission denied the ZFS utilities must be run as root.
Permission denied the ZFS utilities must be run as root.
zfs               zfs snapshot po

I assume it has problems since the user do not have sufficient permissions by his own to read a particular something. Via sudo, the user do have permissions to do so, but I guess that the zsh compinit does not run via sudo.

But there is obviously some way to get it to work, since Bash manages it just fine.

Q:

How can I get zsh to autocomplete correctly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.