Describe the bug
The official GitHub CLI Debian package installs the zsh completion file at:
/usr/share/zsh/site-functions/_gh
On Debian/Ubuntu zsh, this directory is not in the default fpath, so compinit does not discover the gh completion automatically.
As a result, after installing gh from https://cli.github.com/packages, zsh completion for gh is not loaded unless the user manually adds /usr/share/zsh/site-functions to fpath or uses eval "$(gh completion -s zsh)".
The package already ships the completion file, so no shell eval should be needed.
Affected version
$ gh version
gh version 2.89.0 (2026-03-26)
https://github.com/cli/cli/releases/tag/v2.89.0
Environment
- zsh: 5.9-6ubuntu2
- zsh-common: 5.9-6ubuntu2
- OS: Ubuntu 24.04
Expected behavior
The Debian package should install the zsh completion file into a directory that Debian/Ubuntu zsh scans by default, most likely:
/usr/share/zsh/vendor-completions/_gh
This directory is documented by Debian's zsh package as the location for third-party package completions and is present in the default fpath.
/usr/share/doc/zsh-common/README.Debian documents the expected locations for packages that install zsh functions:
/usr/share/zsh/vendor-completions
for functions that add functionality to zsh's completion system, and:
/usr/share/zsh/vendor-functions
for other functions.
Also the gh package provided by the Debian and Ubuntu package repos, installs the zsh completion in this directory, as can be seen in the list of files in the gh package. The github provided package should do the same.
Actual behavior
The package installs _gh into:
/usr/share/zsh/site-functions/_gh
but the default zsh fpath on Ubuntu does not include /usr/share/zsh/site-functions.
Checking in a clean zsh:
zsh -fc 'print -rl -- $fpath'
shows paths such as:
/usr/local/share/zsh/site-functions
/usr/share/zsh/vendor-functions
/usr/share/zsh/vendor-completions
/usr/share/zsh/functions/Completion
...
but not:
/usr/share/zsh/site-functions
Suggested fix
Install the zsh completion file in:
/usr/share/zsh/vendor-completions/_gh
instead of:
/usr/share/zsh/site-functions/_gh
for the Debian package only.
Describe the bug
The official GitHub CLI Debian package installs the zsh completion file at:
On Debian/Ubuntu zsh, this directory is not in the default
fpath, socompinitdoes not discover theghcompletion automatically.As a result, after installing
ghfromhttps://cli.github.com/packages, zsh completion forghis not loaded unless the user manually adds/usr/share/zsh/site-functionstofpathor useseval "$(gh completion -s zsh)".The package already ships the completion file, so no shell eval should be needed.
Affected version
Environment
Expected behavior
The Debian package should install the zsh completion file into a directory that Debian/Ubuntu zsh scans by default, most likely:
This directory is documented by Debian's zsh package as the location for third-party package completions and is present in the default
fpath./usr/share/doc/zsh-common/README.Debiandocuments the expected locations for packages that install zsh functions:for functions that add functionality to zsh's completion system, and:
for other functions.
Also the gh package provided by the Debian and Ubuntu package repos, installs the zsh completion in this directory, as can be seen in the list of files in the gh package. The github provided package should do the same.
Actual behavior
The package installs
_ghinto:but the default zsh
fpathon Ubuntu does not include/usr/share/zsh/site-functions.Checking in a clean zsh:
zsh -fc 'print -rl -- $fpath'shows paths such as:
but not:
Suggested fix
Install the zsh completion file in:
instead of:
for the Debian package only.