jorgenschaefer/pyvenv

multiple venvs in different frames

Opened this issue · 3 comments

The title says it all, right now using pyvenv-activate or pyvenv-workon apply changes to all buffers and frames.
I saw from the other issue : #47 that it is a stretch for buffer local effects.

But is there a way to actually have different venvs in different frames at least?

But is there a way to actually have different venvs in different frames at least?

I'm afraid virtualenvs are basically process-global. Buffers or frames make no difference there, they are still part of the same process. I.e. the problems are the same.

I'm afraid virtualenvs are basically process-global.

Why is that the case? From Emacs's perspective, is more to a venv than simply modifications to $PATH?

If not, would it be feasible to set exec-path per-buffer? I see the "This variable may be risky if used as a file-local variable" warning in exec-path's help, but I haven't read enough to know what the potential problems of multiple exec-paths is.

Why is that the case? From Emacs's perspective, is more to a venv than simply modifications to $PATH?

No, but environment variables are process global. You could set process-environment buffer-local, but every process you start, e.g. for completion or for interactive use, has its own buffer-local version, and you have to deal with inheritance.

I tried. It's pretty much impossible to do.

If you have an idea on how to do it, please provide a working PR (with tests). I'd love this feature. :-)