Hi folks,
I’m trying to use the ProjectEnvironment plugin (source code here) on ST4 (4107) on Windows 10. The plugin basically allows you to define environment variables for your Sublime project
It’s not setting the environment variables, so I decided to debug the plugin. In the ProjectEnvironment.py
file, I put a line to output the environment variables
print('DEBUG]] ' + str(os.environ))
This works and the Sublime console shows:
- All of my system variables
- The new variable that gets set
In my instance, I’m setting one called
CHROMIUM_BUILDTOOLS_PATH
I can see all of this output in the Sublime console. However, if I try to get the value from the console, it’s empty:
>>> os.getenv('CHROMIUM_BUILDTOOLS_PATH')
Trying to get another variable works just fine.
>>> os.getenv('SYSTEMROOT')
'C:\\Windows'
I read about how environment variables are handled in this great post here by @OdatNurd. However, it’s not entirely clear to me why these are not persisting.
My guess (based on description in the post) is that the plugin is being loaded by a process which (after running) is going out of scope (does Sublime just shell out to Python?). It seems that the Sublime console is running under a different process which is why I don’t see this.
Is there a working solution for what I’m trying to do? I swear I had gotten this plugin working last year on ST3 (plugin code has not changed)