-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Support environment variables in the settings #15082
Merged
DHowett
merged 26 commits into
microsoft:main
from
ianjoneill:feature/2785-profile-env-vars-with-string-map
Apr 11, 2023
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b0c426b
implement env vars in settings (#2785)
christapley 5036cb0
Invoke-CodeFormat
christapley b4efbb8
Code review feedback
christapley 5d68c94
Code review update (KalleOlaviNiemitalo)
christapley ea56d64
Fix spelling mistake
christapley 9ec2218
Merge branch 'main' into feature/2785-profile-env-vars-with-string-map
zadjii-msft f1c1cc4
fix build (#2785)
christapley 0b6f411
fix code formatting (#2785)
christapley 46a9b35
Run unix2dos on TerminalSettings.h and Profile.h
ianjoneill ad11e67
Merge branch 'main' into feature/2785-profile-env-vars-with-string-map
ianjoneill 95cacbc
It compiles
ianjoneill 3d2e3fd
It works
ianjoneill e4c9cbb
Add warning about environment variables with different cases
ianjoneill fb7ea2d
Tests
ianjoneill 12c1939
Remove refactored methods
ianjoneill b8165ac
Format
ianjoneill 92d2351
Tidy
ianjoneill c60e2e5
Schema
ianjoneill 3c8554f
Don't clobber the WSLENV environment variable
ianjoneill f1a538c
Move til::details::wstring_case_insensitive_compare
ianjoneill 460be47
Make clear() a function of til::env
ianjoneill 722f34e
Helpfully update WSLENV
ianjoneill e7e3f59
Address JSON comments
ianjoneill de5b246
Switch to IMap
ianjoneill 7231f0c
Fix tests
ianjoneill 0bfe19e
Audit mode
ianjoneill File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in an ideal world (which is not the world in which we live), the Connection classes would not have any concept of a "profile". Even so, I'm cool with this since we've committed so many other layering violations in the past five years.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to do anything about this, i just felt like I had a duty to say it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - it seemed silly both this and
TerminalPage
doing the same dance fiddling withWSLENV
though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmmm... now that we have the
WSLENV
dance happening over all provided environment variables inConptyConnection
, do you think that we could get away with moving profile GUID up to TerminalPage?It could become annoying because now we need to copy the user's provided environment map (if there is one! but we do have to copy it because we don't want to edit it inplace since the one living on the profile is durable)... but after all, if TPage provides
WT_PROFILE_ID
via the environment map it will automatically show up inWSLENV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that depends on if we think people will try and override that environment variable.
The keys in the
IMap
are case sensitive - so if someone has added saywt_profile_id
as an environment variable, that'll be stored separately - so back inConptyConnection
one of the two values will be put into the connection's environment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair!
We can fix the interface later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One potential solution would be to pass two environment variable maps to
ConptyConnection
- one containing user variables and one containing "terminal" variables. We'd insert the "terminal" ones into the environment first, and then the user ones. I can implement that as a follow-up if you're happy with that approach (and please say if you have a better name for "terminal" variables too!).