-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
env variables aren't considered on venv activation (which is happening behind the scenes?) #22927
Comments
BTW, peek is deprecated, please remove this from the bug report template.. |
Here's a screencapvscode_py_venv.mp4 |
same here |
Python extension unfortunately does not have access to |
Thanks, that would be a better fix.. I've had to comment out the PS1-modifying block.. 😅 |
Nah Karthik, exporting in the workspace .env file nor setting vars in the terminal env variables section ( |
Sure, btw I didn't claim setting in terminal env setting would work. But setting in as a systems variable should. |
Sorry I don't mean to blame you.. 😅 I'm in an enterprise setting, using a managed dev environment.. No sudo access sadly.. ᓚᘏᗢ My reasoning was to try the terminal env way as it might be deeper than the workspace env file method when it didn't work out.. ¯_(ツ)_/¯ |
No problem I understand. Actually workspace env setting is deeper as it is a feature of the Python extension so applies everywhere, as opposed to terminal specific VS Code setting which only applies to terminal. |
Type: Bug
Behaviour
Expected vs. Actual
Expected:
When using a custom prompt manager, we export the variable
VIRTUAL_ENV_DISABLE_PROMPT
.The activate script looks for this variable and doesn't change the PS1 prompt.
Actual:
The env variable doesn't seem to be respected. Moreover the venv activation doesn't happen when a terminal is spawned.. leading me to deduce VSCode is using a subshell/cached session?
Steps to reproduce:
vscode's default behaviour:
VIRTUAL_ENV_DISABLE_PROMPT
in bashrc/zshrc, restart vscode, then open a new terminal in a venv-containing python folderexpected native behaviour
python.terminal.activateEnvironment
export VIRTUAL_ENV_DISABLE_PROMPT
in bashrc/zshrc)Diagnostic data
python.languageServer
setting: DefaultOutput for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)User Settings
Extension version: 2024.0.1
VS Code version: Code 1.86.2 (903b1e9d8990623e3d7da1df3d33db3e42d80eda, 2024-02-13T19:40:56.878Z)
OS version: Windows_NT x64 10.0.22631
Modes:
Remote OS version: Linux arm64 6.1.0-rpi8-rpi-v8
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: