Closed rabinadk1 closed 1 month ago
This is actually intentional, but im still thinking about what should be default behavior here.
-I
flag in my home directory returns all results in milliseconds.-HI
flag in my home directory never finishes (its still going after 5 minutes).This is because on my system, there are tons of hidden files, including wine symlinks to different parts on the file system, and even links to NAS disks being mounted. Just to mention a few things.
So im worried about the use case where a user starts VenvSelect in $HOME and nothing shows up, and his CPU goes to 100% for a long time until he force quits neovim.
On the other hand, I really want the plugin to search for hidden files in CWD when its not $HOME.
Maybe a good default would be to warn the user if he tries to launch a search in $HOME, and have an option to enable it.
Or maybe just have VenvSelect kill the search if it doesn't finish in 10 seconds and tell the user it took too long and he should try a directory with less files.
I added code to make VenvSelect stop on searches that take more than 5 seconds. Now I feel we can change the default search to include hidden files, since the plugin will complain if it leads to problems.
The current defaults only search for the Python binary in non-hidden directories when searching in the current working directory. It ignores the folders like '.venv' and '.env', commonly used patterns to name a virtual environment when created using the command
python3 -m venv .venv
.