Skip to content
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

Don't export .env values into the global environment #24209

Open
pamelafox opened this issue Sep 30, 2024 · 2 comments
Open

Don't export .env values into the global environment #24209

pamelafox opened this issue Sep 30, 2024 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug needs spike Label for issues that need investigation before they can be worked on.

Comments

@pamelafox
Copy link
Member

Currently the Python extension exports the .env values into the global environment. That feature caused my days of debugging this year, due to its interaction with the azd CLI (Azure/azure-dev#4384), and I had absolutely no expectation that such a feature would exist. I know that there is a way in settings to turn it off, but I think that it should be an opt-in feature since it can have such a confusing effect on the local environment.

I have not heard of any other language extensions having the same feature, either.

@pamelafox pamelafox added the feature-request Request for new features or functionality label Sep 30, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Sep 30, 2024
@karthiknadig karthiknadig self-assigned this Oct 1, 2024
@karthiknadig karthiknadig added bug Issue identified by VS Code Team member as probable bug needs spike Label for issues that need investigation before they can be worked on. and removed triage-needed Needs assignment to the proper sub-team feature-request Request for new features or functionality labels Oct 1, 2024
@karthiknadig
Copy link
Member

An activated terminal environment is somewhat strange rom general languages perspective. May be we can make the setting more explicit with not defaults, something like: python.terminal.envFile. this way it only works i you set it a .env.

I will need to investigate this further to see i this breaks any expectations of existing users. Surface it better, in cases where it might get missed. Define a clearer overriding order between the various ways you can set environment variables.

@anthonykim1
Copy link

Also would be beneficial to explain/define behavior for when changes are made to existing env file (and user has not restarted), when env file suddenly does not exist (file deletion from user), what happens when extension is deactivated (do we store cached env somewhere). Related: #23856

@anthonykim1 anthonykim1 self-assigned this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug needs spike Label for issues that need investigation before they can be worked on.
Projects
None yet
Development

No branches or pull requests

3 participants