Repository navigation
.env file content isn't autoloaded into a terminal, despite coresponding settings being set. #25569
Copy link
Copy link
Open
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Type: Bug
Behaviour
In my settings.json:
"python.envFile": "${workspaceFolder}/.env",
"python.terminal.activateEnvInCurrentTerminal": true,
And there's sertainly a .env file in the path I open my VS Code at. I can load .env manually via set -a; source .env; set +a command, but I believe it was done automatically before. Now it doesn't work for some reason. I believe it's a bug.
Steps to reproduce:
Besides what I wrote before, I'll notice that I use several instances of VS Code. even though I didn't really check if it's any relevant, sorry.
Extension version: 2025.17.2025110501
VS Code version: Code 1.105.1 (7d842fb85a0275a4a8e4d7e040d2625abbf7f084, 2025-10-14T22:33:36.618Z)
OS version: Linux x64 6.8.0-87-generic
Modes:
- Python version (& distribution if applicable, e.g. Anaconda): 3.12.3
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Venv
- Value of the
python.languageServersetting: Default
User Settings
venvPath: "<placeholder>"
languageServer: "Pylance"
testing
• pytestEnabled: true
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| autodocstring | njp | 0.6.1 |
| codeium | Cod | 1.48.2 |
| debugpy | ms- | 2025.15.2025110501 |
| even-better-toml | tam | 0.21.2 |
| git-graph | mhu | 1.30.0 |
| jinja | who | 0.0.8 |
| js-debug | ms- | 1.105.0 |
| js-debug-companion | ms- | 1.1.3 |
| jupyter | ms- | 2025.9.1 |
| jupyter-keymap | ms- | 1.1.2 |
| jupyter-renderers | ms- | 1.3.0 |
| python | ms- | 2025.17.2025110501 |
| python-environment-manager | don | 1.2.7 |
| remote-containers | ms- | 0.430.0 |
| remote-explorer | ms- | 0.5.0 |
| remote-server | ms- | 1.5.3 |
| remote-ssh | ms- | 0.120.0 |
| remote-ssh-edit | ms- | 0.87.0 |
| remote-wsl | ms- | 0.104.3 |
| ruff | cha | 2025.28.0 |
| vscode-django | bat | 1.15.0 |
| vscode-docker | ms- | 2.0.0 |
| vscode-dotnet-runtime | ms- | 2.3.7 |
| vscode-js-profile-table | ms- | 1.0.10 |
| vscode-jupyter-cell-tags | ms- | 0.1.9 |
| vscode-jupyter-slideshow | ms- | 0.1.6 |
| vscode-pylance | ms- | 2025.9.100 |
| vscode-remote-extensionpack | ms- | 0.26.0 |
| vscode-stripe | str | 3.8.6 |
System Info
| Item | Value |
|---|---|
| CPUs | 11th Gen Intel(R) Core(TM) i3-1125G4 @ 2.00GHz (8 x 1999) |
| GPU Status | 2d_canvas: enabled 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 trees_in_viz: disabled_off video_decode: enabled video_encode: disabled_software vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: disabled_off webnn: disabled_off |
| Load (avg) | 1, 2, 1 |
| Memory (System) | 7.53GB (1.40GB free) |
| Process Argv | --crash-reporter-id 13d2fa3b-1c8c-47d7-8dbe-d56358838b68 |
| Screen Reader | no |
| VM | 0% |
| DESKTOP_SESSION | plasma |
| XDG_CURRENT_DESKTOP | KDE |
| XDG_SESSION_DESKTOP | KDE |
| XDG_SESSION_TYPE | x11 |
A/B Experiments
vsliv368:30146709
binariesv615:30325510
vscrpc:30673769
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31334701
aj953862:31281341
nes-set-on:31351930
6abeh943:31336334
envsdeactivate2:31353495
aa_c:31379599
c12345:31413568
gaj49834:31404438
asdad-cf:31397862
cloudbuttont:31379625
todos-1:31405332
qwen_all_req:31402696
treatment_gpt5applypatchexclusively:31412086
3efgi100_wstrepl:31403338
trigger-command-fix:31379601
auto_model_enabled:31385282
use-responses-api:31390855
defaultsignin:31399436
auto_g2946222:31414244
je187915:31407605
d5i5i512:31405346
ff8f5884:31411053
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Activity
eleanorjboyd commentedon Nov 11, 2025
can you try
"python.terminal.useEnvFile": trueand see if that works?LarsonPaul1 commentedon Nov 14, 2025
I'm encountering the same issue. VSCode version 1.105.1, extension version 2025.18.0, Ubuntu 24.04.3 LTS.
Toggling the value of
"python.terminal.useEnvFile"appears to have no effect.However, when I have a terminal already open in a project, re-opening the project or reloading (
Developer: Reload Window) causes the environment to activate.EDIT 2025-11-18: I believe I misunderstood the original issue, and was encountering a different issue. That being said, my issue has stopped occurring as of the latest version of VSCode (1.106.0).
Vitalii-Kh95 commentedon Nov 15, 2025
I found there were already topics on this issue. Like this one:
#25294
I also discovered I had Python Environment Manager extension marked as (deprecated) for some reason.
And now it's Python Environments that is reccomended to use.
I haven't tried testing it as a mean to load .env file though, as I decided to try using bash script loading .env instead, as it seams to be more language agnostic way to do it. Frankly I was a little bit surprised it was a PYTHON extension specific feature in the first place...
Anyway I think the issue should be closed.