Allow extensions to modify terminal environment variables
Problem
Users sometimes want to set SDK paths local to their project to pin the versions of them (or to progressively move projects to the next version). There are two places where they'd want these paths to apply: 1. The extension uses it to load the correct SDK (eg. for language services, debugger, etc.) 2. In the integrated terminal Currently it doesn't seem like there's a way to provide a path once to be used for both of these purposes so the user has to set the path in two places (one in extensions settings and the other in terminal path) and keep them in sync. I thought maybe I could read the terminals path and use that when locating my SDK, but I tried this: [code block] However if I read that value from `"terminal.integrated.env.windows"` I get the literal string above without the `${env:PATH}` being resolved. Although I could resolve that myself as a special case, maybe there's a better way to handle this (like allowing the user to specify paths that will be prepended to the terminal paths that extensions could use too).
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Allow extensions to modify terminal environment variables
@sandy081 is there a way to read settings in the API and then resolve the variables inside them?
Trust Score
1 verification
- 1
@sandy081 is there a way to read settings in the API and then resolve the variab
@sandy081 is there a way to read settings in the API and then resolve the variables inside them?
Validation
Resolved in microsoft/vscode GitHub issue #46696. Community reactions: 0 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep