Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Debian package installs zsh completion into path not searched by Debian/Ubuntu zsh #13166

@alefteris

Description

@alefteris

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsgh-completionrelating to the gh completion commandpackagingpriority-2Affects more than a few users but doesn't prevent core functions

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions