Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom environment variables in settings.json map #13406

Closed
WanderLanz opened this issue Jun 30, 2022 · 4 comments
Closed

custom environment variables in settings.json map #13406

WanderLanz opened this issue Jun 30, 2022 · 4 comments
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@WanderLanz
Copy link

WanderLanz commented Jun 30, 2022

Description of the new feature/enhancement

Adding a new settings.json mapping for extra environment variables injected by conpty initialization,
allowing for user-set environment variables to be handled directly by WindowsTerminal and passed to children as WT_SESSION and WT_PROFILE_ID are.

As it stands, using SETX to load custom environment variables into every terminal child invites cloberring of vars like WSLENV, since WindowsTerminal manually appends and prepends WT_SESSION and WT_PROIFLE_ID to WSLENV.

...
This stems from #7130 and modules wishing to find the equivalent of "$env:WT_SETTINGS". I could not find a similar request, but I apologize in advance if this is a superfluous suggestion.

Proposed technical implementation details (optional)

Using internal "_environment" in ConptyConnection.cpp as external settings.json map "environment", if possible, since "_environment" seems to already handle injecting arbitrary* environment variables.

@WanderLanz WanderLanz added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Jun 30, 2022
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Jun 30, 2022
@j4james
Copy link
Collaborator

j4james commented Jul 2, 2022

If I've understood you correctly, I think this may be a duplicate of #2785.

@WanderLanz
Copy link
Author

@j4james Yes it would seem I might have done something unnecessary!

My suggestion is specifically referring to global environment variables for every profile rather than profile-by-profile, because the way ConptyConnection.cpp adds both WT_SESSION and WT_PROFILE_ID made it seem like it would be easier.

I feel like I should leave this open for now unless #9287 also implements a global "environment" or the profile-by-profile solution is as far as custom environments directly from settings.json will go.

Feel free to close this if you feel it is a duplicate, this is by no means a first-class priority.

@j4james
Copy link
Collaborator

j4james commented Jul 3, 2022

I haven't looked at PR #9287 in detail, but I think your use-case should be covered by the "Defaults" profile. If you set an environment variable in "Defaults", I assume that would be the equivalent of a "global" environment variable that would apply to all profiles. That's the way other profile settings work.

@WanderLanz
Copy link
Author

@j4james Thank you for the clarification, I'll go ahead and close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants