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

Automatic profile detection for Cmder based on %CMDER_ROOT% variable #16371

Closed
DRSDavidSoft opened this issue Nov 24, 2023 · 2 comments
Closed
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Attention The core contributors need to come back around and look at this ASAP. 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

@DRSDavidSoft
Copy link

Good morning, WT team!

Description of the feature request

I'm looking for a method where Windows Terminal would be able to detect a Cmder installation automatically and add it to the profiles section if it found one. The closest relevant issue I found is #1424, but I did not find a solution for it.

This feature request was original asked by one of our users in the Discussions sections for Cmder + Windows Terminal integration.

Proposed technical implementation details

This feature works in other terminals (such as Tabby's integration with Cmder) based on the existence of the %CMDER_ROOT% environment variable path and some hard coded paths to detect both the Clink-based shell and the customized Shell that Cmder provides. It would be great if Windows Terminal could also do that.

As an alternative and better solution to hard-coded paths, it would be awesome if somehow it was possible to signal a manifest-like file (such as manifest.json) that would include the title, color, name and path for different shells that a package such as Cmder supports. I'm not sure if a feature like this already exist in Windows Terminal.

The current status

Currently, the way that Cmder handles this is by manually adding the Cmder profile and Cmder powershell profile to the list of Windows Terminal profiles. We have to keep a track of these profiles and apply adjustments manually.

Alternatively, a flavor of Cmder is designed to ship with the portable version of Windows Terminal. These are all great approaches, but it would be even better if we could avoid shipping a bundled version of Windows Terminal with each Cmder release in case where one is already installed on the target user's machine, and simply integrate Cmder's shells as Windows Terminal profiles there.

With ❤️ , as a Windows Terminal user, thanks for all the great work that you do with this awesome product!

image

@DRSDavidSoft DRSDavidSoft added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Nov 24, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot 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 Nov 24, 2023
@lhecker
Copy link
Member

lhecker commented Nov 27, 2023

As an alternative and better solution to hard-coded paths, it would be awesome if somehow it was possible to signal a manifest-like file (such as manifest.json) that would include the title, color, name and path for different shells that a package such as Cmder supports. I'm not sure if a feature like this already exist in Windows Terminal.

We do support "fragments" which is similar to what you describe. See here: https://learn.microsoft.com/en-us/windows/terminal/json-fragment-extensions
Is that what you had in mind? Does this lack some features that you'd need? (There are alternative approaches we could take, but fragments are available already and fairly flexible.)

@lhecker lhecker added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Nov 27, 2023
@DRSDavidSoft
Copy link
Author

@lhecker Thank you for the information about fragments, it seems this is the intended way for developers to introduce their profiles to WT.

Additionally, I understand this approach is more secure than reading an environment variable, since instead of reading an arbitrary path that could have been set by any program, the actual program in question actually needs to drop fragment.json in either a user-wide or system-wide directory that is controlled by WT.

The only downside is that due to Cmder's default portable nature, there is no post-install proccess going on that could automate placing the fragment file, but this approach is still way better than writing a script to locate the settings.json file, and modify it to add the new profile/color scheme. Ultimately, it's a fair approach to ask the user to execute the functionality of the program that would place the fragment in WT's directory.

I'll do some tests, and in the meantime will close this issue for now. Thank you once again for the guidance and mentioning fragments!

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Nov 27, 2023
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-Attention The core contributors need to come back around and look at this ASAP. 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