-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Expose the profile GUID to the environment (WT_PROFILE, WT_PROFILE_GUID?) #3589
Comments
I'd settle for setting WT_SESSION to the profile GUID instead of the seemingly pointless session GUID... |
It's possible to have the profile open in multiple places though, with different "sessions" -- I think this guid is keyed to the conpty connection itself, so it kinda needs to be unique globally. |
@oising The main goal would be for a program running inside of windows terminal to be able to "find" what profile it is currently using, so that it can customize the settings.json for that profile in real-time. As far as I understand there is no API to determine that using the WT_SESSION variable, unless you can enlighten me. Invoke-TerminalGif as an example (currently I have to do a nasty workaround to make it work): It doesn't have to replace WT_SESSION, it could instead be WT_PROFILE_GUID as mentioned. |
It "needs" to be unique for what? What can we use a session guid for? |
@oising As the OP of this issue, the proposal you have here #4852 (comment) would satisfy my requirement and this can be closed once merged |
@JustinGrote It's in the PR now as |
But we won't get it until some time after 1.0 - so the idea of using it in a script is basically DOA for months. |
I tried :/ |
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. * [x] CLA signed * [ ] Tests added/passed * [ ] Requires documentation to be updated * [x] 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
It got merged after all - just had to remove the file path env vars for the moment :) /cc @Jaykul |
Thanks @oising! |
🎉This issue was addressed in #4852, which has now been successfully released as Handy links: |
Description of the new feature/enhancement
We need a way to detect within a running terminal what profile instantiated it, so that we can make on-the-fly changes to the config (like change the background or font). The MSTerminalSetting is an example of that method.
Proposed technical implementation details (optional)
Provide the steps/api to PInvoke to get the profile guid based on the session guid. OR expose the session's profile guid to an environment variable like WT_PROFILE
The text was updated successfully, but these errors were encountered: