diff --git a/bash/.bash_functions b/bash/.bash_functions index ea472bf..d4f8348 100644 --- a/bash/.bash_functions +++ b/bash/.bash_functions @@ -434,10 +434,9 @@ loadvenv() { while [[ "$PWD" != "/" ]]; do for x in $(fd -HI -td --maxdepth=1); do - if [[ "$x" == '.venv/' || "$x" == 'venv/' ]]; then + if [[ -f "$x/bin/activate" ]]; then source "${x}/bin/activate" - cd "$init_dir" - return + break 2 fi done diff --git a/bash/.bash_profile b/bash/.bash_profile index f9feced..cd84c01 100644 --- a/bash/.bash_profile +++ b/bash/.bash_profile @@ -99,4 +99,6 @@ fi # Bash completion ==== source_completion_scripts +loadvenv + # vim: set ft=bash ff=unix: