From 88e9ab13e8fd603c732a4f43f1ff3d1c2d264b6a Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Wed, 9 Sep 2026 02:17:04 +0300 Subject: [PATCH] pwsh: Fix error in shell integration if pyenv is on PATH multiple times Fixes "The term 'pyenv pyenv' is not recognized..." --- libexec/pyenv-init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libexec/pyenv-init b/libexec/pyenv-init index b45181fa..34f1173e 100755 --- a/libexec/pyenv-init +++ b/libexec/pyenv-init @@ -473,12 +473,12 @@ function pyenv { } if ( ("${commands[*]}" -split ' ') -contains \$command ) { - \$shell_cmds = (& (get-command -commandtype application pyenv) sh-\$command \$args) + \$shell_cmds = (& (get-command -commandtype application pyenv -totalcount 1) sh-\$command \$args) if ( \$shell_cmds.Count -gt 0 ) { iex (\$shell_cmds -join "\`n") } } else { - & (get-command -commandtype application pyenv) \$command \$args + & (get-command -commandtype application pyenv -totalcount 1) \$command \$args } } EOS