Type: Debugger
Describe the bug
To Reproduce
Start VS Code from the Developer Command Prompt.Additional context
Developer Command Prompt and found that it was actually setting the environment variables for the current workspace. For example, these variables are set by the vcvarsall.bat batch file.MSBuild (and I don't know if there are any other hidden dangers).cd workspace run code . with vsCode. Or is there any way to run the load environment variable when vsCode starts?I agree. Theoretically we could run the VcDevCmd.bat (auto-find and/or setting) and add the results to the process.env.
Expectantly sir
I am experiencing a similar issue where I am using the QNX compiler, which requires %QNX_HOST% to be set. For our environment variables we are using activate.bat coming from conan.
It is necessary to have QNX_HOST in the environment. Otherwise the gcc compiler cannot be queried for include paths.
It would be nice if I can set this setting in my c_cpp_properties.json in the workspace.
As a workaround I run activate.bat and then start vs-code in a similar fashion as you do with vcvarsall.
Look forward together
Unfortunately, we can't change the environment after you launch VS Code. We don't have permission to do that. You do have an opportunity to run a script as part of your tasks.json command, but those variables won't exist and be available to our extension. This would need to be a feature request on the VS Code team if you want to modify the environment after launching the editor.
Unless I'm misunderstanding, that's now on the draft iteration plan for March.
Should this issue be renamed and reopened (or a new one created) for when that lands to add @sean-mcmanus' suggestion?
@SuperWig What's on the draft iteration plan for March? You mean for VS Code? I don't see any related issue. Can you add a link to that?
What's on the draft iteration plan for March? You mean for VS Code?
@sean-mcmanus Yes for VS Code, "Allow extensions to customize the environment of terminal processes" is in the iteration plan for March.
There wasn't a linked issue when I saw it yesterday but it's there now as https://github.com/microsoft/vscode/issues/46696
Most helpful comment
I am experiencing a similar issue where I am using the QNX compiler, which requires %QNX_HOST% to be set. For our environment variables we are using
activate.batcoming from conan.It is necessary to have QNX_HOST in the environment. Otherwise the gcc compiler cannot be queried for include paths.
It would be nice if I can set this setting in my
c_cpp_properties.jsonin the workspace.As a workaround I run activate.bat and then start vs-code in a similar fashion as you do with vcvarsall.