Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Instructions for zsh in pipx completions Output #1296

Merged
merged 8 commits into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1296.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update screen output provided by `pipx completions` for zsh/argcomplete v3
24 changes: 17 additions & 7 deletions src/pipx/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 do not already have argcomplete installed,
mjs271 marked this conversation as resolved.
Show resolved Hide resolved
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
Expand All @@ -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`

Expand Down