You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I develop using WSL on my Windows machine. I use the Remote plugin to connect to my Ubuntu 22.04 instance and open folders from there.
Issue:
I have been running into a consistent problem where my ${workspaceFolder} environment variable is not being set, it is empty. I have confirmed this by setting my "PYTHONPATH" to "PYTHONPATH=${workspaceFolder}" in a .env file and from the terminal, after loading in variables from this .env file I run echo $PYTHONPATH and it returns empty. I have double checked this by opening the same folder in vscode running on Windows and it is set correctly here. The correct path should be "/home/enda/QuantStudies"
Running on WSL using Remote plugin:
Opened folder workspace:
Empty python path variable which should be set to ${workspaceFolder}
.env file used to set the PYTHONPATH to the ${workspaceFolder}
Confirmed this gets set when I open the same repo on Windows
VS Code version: Code 1.97.1 (e249dada235c2083c83813bd65b7f4707fb97b76, 2025-02-10T13:13:58.153Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2
The text was updated successfully, but these errors were encountered:
enda-quantmatix
changed the title
Workspace environment variable is not being set
Workspace environment variable ${workspaceFolder} is not being set/empty on WSL
Feb 13, 2025
${workspaceFolder} is a VS Code internal variable that can be used with certain VS Code settings or in VS Code launch configurations.
You can't use it in .env files unless you have defined an OS env variable with that name.
When running on WSL, OS env variables are defined through the shell configuration scripts like .bashrc or can be exported from Windows. VS Code doesn't add or remove anything here.
I forgot to add that I do also have a settings.json where I also try to set the PYTHONPATH using the ${workspaceFolder}. However, I just discovered that the setting I was using was for Windows and not Linux!
I added "terminal.integrated.env.linux": { "PYTHONPATH": "${workspaceFolder}" },
and that has fixed my issue
Type: Bug
I develop using WSL on my Windows machine. I use the Remote plugin to connect to my Ubuntu 22.04 instance and open folders from there.
Issue:
I have been running into a consistent problem where my ${workspaceFolder} environment variable is not being set, it is empty. I have confirmed this by setting my "PYTHONPATH" to "PYTHONPATH=${workspaceFolder}" in a .env file and from the terminal, after loading in variables from this .env file I run
echo $PYTHONPATH
and it returns empty. I have double checked this by opening the same folder in vscode running on Windows and it is set correctly here. The correct path should be "/home/enda/QuantStudies"Running on WSL using Remote plugin:

Opened folder workspace:

Empty python path variable which should be set to ${workspaceFolder}

.env file used to set the PYTHONPATH to the ${workspaceFolder}

Confirmed this gets set when I open the same repo on Windows

VS Code version: Code 1.97.1 (e249dada235c2083c83813bd65b7f4707fb97b76, 2025-02-10T13:13:58.153Z)
OS version: Windows_NT x64 10.0.26100
Modes:
Remote OS version: Linux x64 5.15.133.1-microsoft-standard-WSL2
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
webnn: disabled_off
Extensions (115)
(14 theme extensions excluded)
A/B Experiments
The text was updated successfully, but these errors were encountered: