Provide standardized way on how env variables override .env
See original GitHub issueEnvironment data
- VS Code version: 1.23.1
- Extension version (available under the Extensions sidebar): 2018.4.0
- OS and version: 10.12.6
- Python version (& distribution if applicable, e.g. Anaconda): 3.6.5
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): venv
Actual behavior
envFile
variables override launch.json
env
variables
Expected behavior
launch.json
env
variables override envFile
variables
Steps to reproduce:
- Define
envFile
with a variable - Define an env variable in
launch.json
with the same name - Run a script
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Environment variables to configure the AWS CLI
If defined, this environment variable overrides the value for the profile setting region . You can override this environment variable by using the...
Read more >We need to talk about the .env | Platform.sh
Environment variables are system-global string values that any application can read at any time and use that to make decisions about what code ......
Read more >Working with Environment Variables in Python - Twilio
In my opinion, a better way to manage your environment variables is to store them in a .env (pronounced dot env) file. A...
Read more >Environment Variables in Apache
The most basic way to set an environment variable in Apache is using the ... possible to override or change the standard CGI...
Read more >Use environment variables | Cloud Run Documentation
The environment variables defined in the container runtime contract are reserved and cannot be set. In particular, the PORT environment variable is injected ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello,
In official VSCode Debug Node.js documentation, we can see that env variables override envFile variables (
Any environment variable specified in the env dictionary will override variables loaded from the file.
).In Python, it’s the opposite. I didn’t find something which describes the behavior in the documentation. It’s a bit confusing to have a different precedence compared to another language (ie. Node.js). Is-it possible, at least, to put the variables precedence described here in the documentation?
Thx
Thanks from bringing it up @WeetA34, I created https://github.com/microsoft/vscode-docs/issues/3674 so we can clarify that in our documentation.
We might need to revisit how we handle this in the extension as well.