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
It would be convenient to add this feature.
I'm using conan (C/C++ package manager), and I need to initialize several environment variables (PATH, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH basically), before running executables having runtime dependencies. conan can generate a shell to source, a .bat for windows, and a dotenv file.
The content of those environment variables can be very complex, it can change after an update of the dependency graph, or a switch between CMake build types, so hardcoding env vars in cmakeExplorer.extraCtestEnvVars is not an option here.
The text was updated successfully, but these errors were encountered:
That's a good idea, I'll add dotenv support in the next version. BTW do you know the order of precedence between environment and envFile? envFile is supported by VS Code directly in debug mode, however it needs special support for run mode 1 and I want to keep the same semantics for both.
Footnotes
reading the dotenv file and passing its content to Node child_process.spawn↩
BTW do you know the order of precedence between environment and envFile? envFile is supported by VS Code directly in debug mode
AFAIK it's not supported directly by VSCode, I mean it's specific to each VSCode debugging configuration. For example C/C++ extension supports envFile, node debugging type also, or python extension, but not (yet) CodeLLDB extension. So I guess that order of precedence is implementation specific.
I guess envFile could be injected first, then environment since the later is more specific.
Anyway both should be injected. If you do something like this: PATH="<somepath>:$PATH" (Unix) or PATH=<somepath>;%PATH% (Windows) in each one, it's additive.
Currently, CMake test explorer allows to hardcode env vars in
cmakeExplorer.extraCtestEnvVars
.But there is no way to load env vars from a dotenv file like in C/C++ extension debugging configuration (https://code.visualstudio.com/docs/cpp/launch-json-reference#_environment-variable-definitions-file).
It would be convenient to add this feature.
I'm using conan (C/C++ package manager), and I need to initialize several environment variables (PATH, LD_LIBRARY_PATH or DYLD_LIBRARY_PATH basically), before running executables having runtime dependencies. conan can generate a shell to source, a .bat for windows, and a dotenv file.
The content of those environment variables can be very complex, it can change after an update of the dependency graph, or a switch between CMake build types, so hardcoding env vars in
cmakeExplorer.extraCtestEnvVars
is not an option here.The text was updated successfully, but these errors were encountered: