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

Closed
opened 2026-01-31 07:26:49 +00:00 by claunia · 3 comments
Owner

Originally created by @DRSDavidSoft on GitHub (Nov 24, 2023).

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

Originally created by @DRSDavidSoft on GitHub (Nov 24, 2023). 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](https://github.com/orgs/cmderdev/discussions/2864#discussioncomment-6545515) 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](https://github.com/Eugeny/tabby/blob/master/tabby-electron/src/shells/cmder.ts)) 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](https://github.com/microsoft/terminal/assets/4673812/95e35300-743d-41b5-9240-ecdf3c96eda5)
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 07:26:49 +00:00
Author
Owner

@lhecker commented on GitHub (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 commented on GitHub (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.)
Author
Owner

@DRSDavidSoft commented on GitHub (Nov 27, 2023):

@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!

@DRSDavidSoft commented on GitHub (Nov 27, 2023): @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!
Author
Owner

@candrapersada commented on GitHub (Aug 28, 2025):

but until now still not told how to Automatic profile detection for Cmder?

@candrapersada commented on GitHub (Aug 28, 2025): but until now still not told how to Automatic profile detection for Cmder?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20886