From d01d10e50b1e7dd679ddcc61649b5b3b89780f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=A1=E9=A3=8E?= <1795771535y@gmail.com> Date: Sun, 14 Jun 2026 10:53:39 +0800 Subject: [PATCH] fix(pipenv): use argcomplete for pipenv >= 2026.5.0 pipenv >= 2026.5.0 dropped the _PIPENV_COMPLETE environment variable and switched to argcomplete for shell completions. Check for register-python-argcomplete command and use it when available, falling back to the old _PIPENV_COMPLETE method for older pipenv versions. Fixes #13719 --- plugins/pipenv/pipenv.plugin.zsh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/pipenv/pipenv.plugin.zsh b/plugins/pipenv/pipenv.plugin.zsh index 76d66b301..e1777ec15 100644 --- a/plugins/pipenv/pipenv.plugin.zsh +++ b/plugins/pipenv/pipenv.plugin.zsh @@ -10,7 +10,12 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_pipenv" ]]; then _comps[pipenv]=_pipenv fi -_PIPENV_COMPLETE=zsh_source pipenv >| "$ZSH_CACHE_DIR/completions/_pipenv" &| +# pipenv >= 2026.5.0 dropped _PIPENV_COMPLETE in favor of argcomplete +if (( $+commands[register-python-argcomplete] )); then + register-python-argcomplete pipenv >| "$ZSH_CACHE_DIR/completions/_pipenv" &| +else + _PIPENV_COMPLETE=zsh_source pipenv >| "$ZSH_CACHE_DIR/completions/_pipenv" &| +fi if zstyle -T ':omz:plugins:pipenv' auto-shell; then # Automatic pipenv shell activation/deactivation