Recreating `.venv` with no console on it drops the venv from both interpreter pickers
After .venv is deleted and created again, neither Interpreter: Start New Console Session nor Python: Select Interpreter has any row for the workspace venv, and it was still missing 45 s later. Interpreter: Discover All Interpreters brings it back.
The picker lists the recreated venv at its new version, Python 3.12.3 (uv: exploratory-workspace), as it does when the venv is the selected interpreter or has a console running.
/tmp/exploratory-workspace/.venvmade withuv venv --python /root/.pyenv/versions/3.13.0/bin/python3.13 .venv, listed asPython 3.13.0 (uv: exploratory-workspace)- The workspace's selected interpreter is not the venv: here the Python 3.10.12 (uv: root) console the window started at launch is open and selected
- No running console uses the venv (the earlier one was deleted from the console's session list)
- Run
Interpreter: Start New Console Session. - Verify the picker lists
Python 3.13.0 (uv: exploratory-workspace)PASS - Run
rm -rf .venv && uv venv -q --python /usr/bin/python3.12 .venv && .venv/bin/python --versionin the terminal, and wait 20 s. - Run
Interpreter: Start New Console Session. - Verify the picker lists
Python 3.12.3 (uv: exploratory-workspace)FAIL 4
Evidence · 3 log lines
Interpreter: Discover All Interpreters, so nothing resolved the new bin/pythonLikely cause · Hypothesis
The folder delete now removes the venv, and nothing adds the new one back. The new ** delete watcher in extensions/positron-python/src/client/pythonEnvironments/base/locators/common/pythonWatcher.ts reports the deleted .venv folder, and workspaceEventHandler in extensions/positron-python/src/client/pythonEnvironments/nativeAPI.ts (the isParentPath filter in its delete branch) removes every env under it. The re-add relies on the unchanged **/bin/python watcher, and the locator log shows no resolve of the new bin/python afterwards. The watcher probably reports the new folder as one create for .venv, mirroring the delete, so the pattern never matches. When the venv is the selected interpreter, the active-env-deleted refresh re-adds it, which is why a running console or a selected venv hides this. One try where the watcher reported the recreate as an update of bin/python kept the venv. Before the change the folder delete matched no pattern and left the entry in place. The removal is new in this change, and the missing re-add on creation is in watcher code the change does not touch.
Test gap · 1 missing case
- After the folder holding an env is deleted, a Created event for that folder (not for its
bin/python) puts the env back in the list

