EnvFile
EnvFile copied to clipboard
Use parent environment to allow variable substitution
I'm experimenting to support EnvFile with [BashSupport Pro}(https://www.bashsupport.com). I noticed that the variable substitution isn't working as it should.
Currently EnvFile only provides the variables configured directly in the run configuration to the var env providers.
Now, if a variable substitution references a variable, which is inherited from the parent environment, then it has an empty value. That's happening because eneralCommandLine.getEnvironment()
is not including the variables from the parent environment.
The SDK's process setup adds the parent environment variables to the new process, if the setting for this is enabled: https://github.com/JetBrains/intellij-community/blob/8e89a51b18059a34081c84439c6c19483f64ad10/platform/platform-util-io/src/com/intellij/execution/configurations/GeneralCommandLine.java#L469
EnvFile must follow the same logic to provide the same set of variables to the patched command line. I successfully tested this with Python, the other modified providers follow the same logic.
I don't know much about EnvFile
, but hope that this is helpful.
Can I help with anything to get this merged?