openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.32k stars 1.72k forks source link

zpool <TAB> completion only works after running zfs <TAB> #16320

Open Impact123 opened 5 days ago

Impact123 commented 5 days ago

System information

Type Version/Name
Distribution Name Debian
Distribution Version 12 (Bookworm)
Kernel Version 6.1.0-22-amd64
Architecture x86_64 (amd64)
OpenZFS Version 2.2.4 (zfs-2.2.4-1~bpo12+1)

Describe the problem you're observing

I noticed that thezpool <TAB> completion does not work until after one has already run zfs <TAB>. This seems to be due to the fact that /usr/share/bash-completion/completions/zpool does not exist but/usr/share/bash-completion/completions/zfs does. A simple "fix" that worked for me is to symlink /usr/share/bash-completion/completions/zfs to /usr/share/bash-completion/completions/zpool or sourceing the /usr/share/bash-completion/completions/zfs file.

Describe how to reproduce the problem

  1. Open a new shell, type zpool and press TAB
  2. Type zfs and press TAB
  3. Type zpool and press TAB
  4. Note the difference between 1 and 3.

    Include any warning/errors/backtraces from the system logs