-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PYENV_VERSION incorrectly set in subshells #2733
Comments
Same issue as #1675 There, the users accepted a workaround (to detect the specific use case and unset |
Thanks, I'll just continue using my workaround in that case. |
If you think this should be changed, you could argue so in that issue. As it's explained there, so far, it's unclear whether we should set |
Nah, think your comment
makes perfect sense and this feature likely keeps away another set of possibly-difficult-to-debug issues. Think sub-terminals launched in this sense is rather specific corner case. However, would it be possible for us to detect that a (interactive) sub-shell is launched in this manner, and thus ignore |
Prerequisite
pyenv
and the defaultpython-build
plugin only. Please refrain from reporting issues of other plugins here.Description
debian testing, amd64
2.3.21
3.11.2
gcc (Debian 12.2.0-14) 12.2.0
This is bit of a corner case, but could lose many hours for other people.
When shell is started from another process (a python one in my case), then this new shell will have
PYENV_VERSION
hardcoded tosystem
value, which will break version detection. This, among other possible problems, breakspyenv-virtualenv
automatic environment activation.Please refer to reproduction program:
When executed, this script will
xterm
by default. please amendTERM_CMD
if you don't have it installed) calling the same script with a flag/bin/bash
This effectively leaves us with a fresh shell.
The problem is:
PYENV_VERSION
in this new shell will have a value ofsystem
pre-set. To work around it, you can eitherlaunch_inplace()
; orunset PYENV_VERSION
from your .bashrc before invokingpyenv init
I can't figure out from pyenv code where solution might lie, as PYENV_VERSION is set in a few places.
The text was updated successfully, but these errors were encountered: