Skip to content

23.2: Unable to add zsh completion as documented #12166

Closed
@Logicer16

Description

@Logicer16

Description

Attempting to follow the steps in the documentation for adding zsh shell completion raises an error regarding the use of compadd outside of a completion function. This seems to be new with 23.2 and added in #11417.

Expected behavior

As in previous versions, following the documented steps should successfully add completion for pip.

pip version

23.2

Python version

3.11.4

OS

macOS 12.6.8

How to Reproduce

As documented:

  1. Execute python -m pip completion --zsh >> ~/.zprofile or add eval "pip completion --zsh" to .zprofile or .zshrc
  2. Start a new shell

Output

From startup:

/dev/fd/16:compadd:4: can only be called from completion function

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: autocompleteAutocompletion in shells (pip completion)type: bugA confirmed bug or unintended behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions