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
{{ message }}
Repository navigation
Add support for environment variables in pathMappings #1069
I got this issue in originally in Cursor. Today, I checked it in VS Code and it is working well like you described. Maybe the fix you didn't landed on Cursor? What do you think about keeping this for any other VS Code clones which might not have latest VS Code?
I'm reluctant to merge this, as this should be fixed by the IDEs... Perhaps try to open an issue with Cursor - they probably do a periodic sync with the main code-base. If ti doesn't work out with them, I'll reconsider merging.
Activity
Tolsee commentedon Nov 13, 2025
#1068
zobo commentedon Nov 13, 2025
Will look at this asap
Tolsee commentedon Nov 13, 2025
Thanks @zobo!
zobo commentedon Nov 13, 2025
The real question here is, why is this not already working? https://code.visualstudio.com/docs/reference/variables-reference#_environment-variables
Tolsee commentedon Nov 13, 2025
I think the substitution works for values, not the keys as shown in the example
{ "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003, "pathMappings": { "/var/www/${env:YOUR_ID}": "${workspaceFolder}/app" }, "ignore": ["**/vendor/**/*.php"] } ] }It may have worked if we have
pathMappingsto be of type{local:string;remote:string}[]?zobo commentedon Nov 15, 2025
I remembered something about this. I already reported this and provided a patch but not sure what happened to this.
microsoft/vscode#245798 microsoft/vscode#245989
I looks like it got merged, but I can't find the code in main.... strange. I need to check this before I merge this patch.
zobo commentedon Nov 16, 2025
I went back and tested this without your patch. And as it looks to me, things work as they should. This was my launch,json
{ "debugServer": 4711, // Uncomment for debugging the adapter "name": "Launch currently open script", "type": "php", "request": "launch", "program": "${file}", "cwd": "${fileDirname}", "port": 0, "runtimeArgs": ["-dxdebug.start_with_request=yes"], "env": { "XDEBUG_MODE": "debug,develop", "XDEBUG_CONFIG": "client_port=${port}" }, "ignoreExceptions": ["IgnoreException"], "pathMappings": { "/var/www/${env:YOUR_ID}": "${workspaceFolder}/app" }, "log": false },And when I debugged what I get from VSC to the adapter on launch request it shows that the
${env:YOUR_ID}was substituted.So, can you look at what the situation is on your end? This is my VSC version
Tolsee commentedon Nov 20, 2025
I got this issue in originally in Cursor. Today, I checked it in VS Code and it is working well like you described. Maybe the fix you didn't landed on Cursor? What do you think about keeping this for any other VS Code clones which might not have latest VS Code?
zobo commentedon Nov 20, 2025
I'm reluctant to merge this, as this should be fixed by the IDEs... Perhaps try to open an issue with Cursor - they probably do a periodic sync with the main code-base. If ti doesn't work out with them, I'll reconsider merging.
zobo commentedon Dec 22, 2025
I will close this as it should be fixed in the IDE.