FG
💻 Software🛠️ Developer ToolsMicrosoft

Allow extensions to modify terminal environment variables

Freshalmost 6 years ago
Mar 14, 20260 views
Confidence Score85%
85%

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

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Allow extensions to modify terminal environment variables

Low Risk

@sandy081 is there a way to read settings in the API and then resolve the variables inside them?

84

Trust Score

1 verification

100% success
  1. 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

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

vscodeideeditorfeature-requestapiverifiedterminal