Skip to content

Add WT_PROFILE_ID to the environment of the spawned process - #4852

Merged
23 commits merged into
microsoft:masterfrom
oising:feature/profile-env-vars
Apr 17, 2020
Merged

23 commits merged into
microsoft:masterfrom
oising:feature/profile-env-vars

Conversation

@oising

@oising Oisin Grehan (oising) commented Mar 9, 2020 •

Copy link
Copy Markdown
Collaborator

This commit adds a WT_PROFILE_ID environment variable, which contains
the guid of the active profile.

It also teaches ConptyConnection to take an environment map on creation.

We had to do a little manual jiggery with the WSLENV environment
variable as passed by the creator.

  • CLA signed
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already.

Ran terminal, validated vars and translated paths under windows and WSL.

References #4566 (this PR originally introduced WT_SETTINGS/DEFAULTS)
Closes #3589

@zadjii-msft Mike Griese (zadjii-msft) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly this looks okay to me. Plumbing the StringMap through makes it easier to add some of the other requests (looking at #3589) as well.

I've just got some nits about dead code, but the changes to OpenConsole.sln probably shouldn't be here. That's literally the only thing blocking me

Comment thread OpenConsole.sln Resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Mar 10, 2020
@oising

Oisin Grehan (oising) commented Mar 10, 2020 •

Copy link
Copy Markdown
Collaborator Author

Honestly this looks okay to me. Plumbing the StringMap through makes it easier to add some of the other requests (looking at #3589) as well.

It seems trivial to roll #3589 into this PR as well -- shall I? it's another three lines of code...

image

wsl

image

(yes, need to normalize the guid formatting)

@zadjii-msft Mike Griese (zadjii-msft) added the Product-Terminal The new Windows Terminal. label Mar 11, 2020
@DHowett-MSFT

Copy link
Copy Markdown
Contributor

(On account of you deleted your comment, I'm guessing something else was up 😉)

@JustinGrote

Copy link
Copy Markdown

If it was me, I realized my comment was incorrect, it was special local config I did. All is good and looking forward to seeing this in 0.11!

@oising

Copy link
Copy Markdown
Collaborator Author

(On account of you deleted your comment, I'm guessing something else was up 😉)

Hey Dustin L. Howett (MSFT) (@DHowett-MSFT) -- did I miss something? Do I need to update the PR?

@JustinGrote

Copy link
Copy Markdown

Oisin Grehan (@oising) this was directed at me I believe.

@miniksa Michael Niksa (miniksa) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@oising

Copy link
Copy Markdown
Collaborator Author

I'm switching myself to make sure this doesn't get automerged into 1.0 accidentally. I believe the consensus on the team is that this is a bit too much of a "feature" to get merged this close to 1.0 tbh. I've moved it into 1.x to have the discussion once the official 1.0 build has been cut 😄

That's disappointing. You guys are shipping 1.0 without a means to edit settings from the UI, and now making it even harder to find the files if you do need to edit them.

@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 10, 2020
@zadjii-msft

Copy link
Copy Markdown
Member

I mean, Ctrl+, will open the settings file by default, and %LOCALAPPDATA%\packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json == %WT_SETTINGS% for all intents and purposes. Sure it's more verbose, but it's no less correct. I get how this is useful, but we're just in a hard place where accepting new features like this late in the cycle is a little hard to sell up the chain unfortunately 😕

Just because it's not making the 1.0 cut doesn't mean it's never happening. It's not like we're gonna ship 1.0 then all get the 'rona and disappear. We just need to make hard cuts on what actually gets in at this point unfortunately (case in point #3789). We'll certainly come back to this ☺️

@Jaykul

Joel Bennett (Jaykul) commented Apr 12, 2020 •

Copy link
Copy Markdown
Contributor

In my opinion, the thing that's really missing in 1.0 is WT_PROFILE_ID (#3589 which cannot be discovered at all ... Mike Griese (@zadjii-msft)

And since the VT color queries were also never finished, there's no way to discover what crazy colors someone's using in their terminal

Joel Bennett (Jaykul) added a commit to Jaykul/EzTheme that referenced this pull request Apr 12, 2020
The PR is blocked until after 1.0, but it looks like this is what they're going to use
microsoft/terminal#4852
@oising

Copy link
Copy Markdown
Collaborator Author

As per discussion with Dustin L. Howett (MSFT) (@DHowett-MSFT) at #4566 (comment) - removed WT_SETTINGS and WT_DEFAULTS and left WT_PROFILE_ID

@zadjii-msft Mike Griese (zadjii-msft) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for bearing with us ☺️

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just the one concern. Thanks Oisin!

@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 16, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Apr 16, 2020
@DHowett-MSFT Dustin L. Howett (MSFT) (DHowett-MSFT) changed the title add wt_defaults and wt_profiles env vars Add WT_PROFILE_ID and add an env map to ConptyConnection Apr 17, 2020
@DHowett-MSFT Dustin L. Howett (MSFT) (DHowett-MSFT) changed the title Add WT_PROFILE_ID and add an env map to ConptyConnection Add WT_PROFILE_ID to the environment of the spawned process Apr 17, 2020

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM thanks so much Oisin

@DHowett-MSFT Dustin L. Howett (MSFT) (DHowett-MSFT) added the AutoMerge Marked for automatic merge by the bot when requirements are met label Apr 17, 2020
@ghost

Copy link
Copy Markdown

Hello Dustin L. Howett (MSFT) (@DHowett-MSFT)!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost
ghost merged commit 38e7cb0 into microsoft:master Apr 17, 2020
@Jaykul

Copy link
Copy Markdown
Contributor

Thanks for rethinking this one, y'all.

@ghost

Copy link
Copy Markdown

🎉Windows Terminal Preview v0.11.1121.0 has been released which incorporates this pull request.:tada:

Handy links:

Charles Milette (sylveon) pushed a commit to LazoVelko/Pokemon-Terminal that referenced this pull request May 1, 2020
* Add Windows Terminal adapter

* [Windows Terminal] Get defaultProfile on globals

* [Windows Terminal] Update with latest version
- profiles.json to settings.json
microsoft/terminal#5199
- Change current profile
microsoft/terminal#4852

* [Windows Terminal] Rename adapter to pass tests

* [Windows Terminal] Update with default profile settings
https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#default-settings
@oising
Oisin Grehan (oising) deleted the feature/profile-env-vars branch May 2, 2020 21:11
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AutoMerge Marked for automatic merge by the bot when requirements are met Needs-Second It's a PR that needs another sign-off Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose the profile GUID to the environment (WT_PROFILE, WT_PROFILE_GUID?)

7 participants