Open palandovalex opened 6 months ago
Basically using $VIRTUAL_ENV
local virtual_env = os.getenv("VIRTUAL_ENV")
if virtual_env then
-- Extract the last part of the $VIRTUAL_ENV path
local venv_name = virtual_env:match("([^/]+)$")
if venv_name then
local venv = { path = virtual_env, name = venv_name }
set_venv(venv)
return
end
end
@aemonge hmm, but wouldn't that only work if you already had the venv activated? I don't actually use the auto_venv
feature myself but if I understand it correctly it's intention is to activate a venv automatically. So that env var wouldn't exist?
You're right !
Wouldn't it be easier to change https://github.com/AckslD/swenv.nvim/blob/main/lua/swenv/api.lua#L200 : ](https://github.com/AckslD/swenv.nvim/blob/main/lua/swenv/api.lua#L188 :
from:
to: