diff --git a/changelog.d/1296.misc.md b/changelog.d/1296.misc.md new file mode 100644 index 0000000000..5148e81fb4 --- /dev/null +++ b/changelog.d/1296.misc.md @@ -0,0 +1 @@ +Update screen output provided by `pipx completions` for zsh/argcomplete v3 diff --git a/src/pipx/constants.py b/src/pipx/constants.py index 1348524d37..fa7a54d8b8 100644 --- a/src/pipx/constants.py +++ b/src/pipx/constants.py @@ -38,8 +38,12 @@ def is_mingw() -> bool: completion_instructions = dedent( """ -If you are using zipapp, run `pipx install argcomplete` before -running any of the following commands. +If you encountered register-python-argcomplete command not found error, +or if you are using zipapp, run + + pipx install argcomplete + +before running any of the following commands. Add the appropriate command to your shell's config file so that it is run on startup. You will likely have to restart @@ -49,16 +53,22 @@ def is_mingw() -> bool: eval "$(register-python-argcomplete pipx)" zsh: - To activate completions for zsh you need to have - bashcompinit enabled in zsh: + To activate completions in zsh, first make sure compinit is marked for + autoload and run autoload: - autoload -U bashcompinit - bashcompinit + autoload -U compinit && compinit - Afterwards you can enable completion for pipx: + Afterwards you can enable completions for pipx: eval "$(register-python-argcomplete pipx)" + NOTE: If your version of argcomplete is earlier than v3, you may need to + have bashcompinit enabled in zsh by running: + + autoload -U bashcompinit + bashcompinit + + tcsh: eval `register-python-argcomplete --shell tcsh pipx`