pyenv-virtualenv: prompt changing not working for fish
Hi! I'm using fish and I'm running into the above message when I do pyenv activate my_venv.
If I do source .../my_venv/activate.fish the prompt shows up so it doesn't look as if it should be impossible to get the same to work with pyenv activate.
This issue is very related/the same as the stale https://github.com/pyenv/pyenv-virtualenv/issues/284
Thank you, and thanks for a great project!
@aronla what message are you seeing?
@agoose77 I get the following:
> pyenv activate myenv
pyenv-virtualenv: prompt changing not working for fish
>
However, when sourcing activate.fish for the env, I get a prompt as expected:
myenv >
I'm also having this issue
I am having this issue as well
It seems like prompt changing will be removed from future release too, I don't know why this is the case.
https://github.com/pyenv/pyenv-virtualenv/blob/294f64f76b6b7fbf1a22a4ebba7710faa75c21f7/bin/pyenv-sh-activate#L214-L234
Most probably, Virtualenv didn't support Fish when this code was written but now, it does. So feel free to submit a PR.
As a workaround, I have added to my config.fish to disable the message:
set -gx PYENV_VIRTUALENV_DISABLE_PROMPT 1
and in my fish_prompt function I use
set pyenv_version (pyenv version-name | string split ':')
and use $pyenv_version to display the active version in the prompt.
Hi, is this latest comment the solution?
-
I installed fish and omf and the pyenv integration and there is no promt, which for me is typical when developing in Python.
-
I hovered around SO and several open/closed issue threads and still not sure why prompt showing was removed or how to bring it back.
Is the right solution to copy paste the above code? Is there something else?

For what it's worth, the following out-of-the-box prompts will display the current virtualenv (select them with the fish_config command):
- Disco
- Nim
- Simple Pythonista
EDIT: Or just use https://github.com/IlanCosman/tide