From 19efcdcd808f6981cf67e1c7ae138e366d6f58f5 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Fri, 24 Apr 2026 16:02:44 -0400 Subject: [PATCH] Show venvs created from system Python Venvs created from system Python are directories, not sym links. The previous code only displayed venvs that were a directory and a symlink. Now check for directory existence and symlink status, or directory existence and the presence of bin/activate within the directory. --- bin/pyenv-virtualenvs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/bin/pyenv-virtualenvs b/bin/pyenv-virtualenvs index 4db819d..6186714 100755 --- a/bin/pyenv-virtualenvs +++ b/bin/pyenv-virtualenvs @@ -116,13 +116,17 @@ for env_path in "${venv_dir_entries[@]}"; do fi done -if [[ -z "$skip_aliases" ]]; then - for env_path in "${version_dir_entries[@]}"; do - if [[ -d ${env_path} ]] && [[ -L ${env_path} ]]; then +for env_path in "${version_dir_entries[@]}"; do + if [[ -d ${env_path} ]]; then + if [[ -L ${env_path} ]]; then + if [[ -z $skip_aliases ]]; then + print_version "${env_path#"${PYENV_ROOT}"/versions/}" "${env_path}" + fi + elif [[ -f "${env_path}/bin/activate" ]]; then print_version "${env_path#"${PYENV_ROOT}"/versions/}" "${env_path}" fi - done -fi + fi +done shopt -u dotglob shopt -u nullglob