Dynamic Profile Generator for Windows PowerShell #7569

Open
opened 2026-01-31 01:07:31 +00:00 by claunia · 3 comments
Owner

Originally created by @TBBle on GitHub (Apr 23, 2020).

Description of the new feature/enhancement

It'd be nice if the "Windows PowerShell" profile worked like the other profiles, and could be disabled using disabledProfileSources.

This would remove the need to carry a 'hidden' overriding profile per #5459, as disabledProfileSources made possible for the other profile sources.

Proposed technical implementation details (optional)

I guess it just needs new IDynamicProfileGenerator implementation, that replaces (and slurps up?) the existing Windows PowerShell profile if present, which appears to have a fixed GUID ({61c54bbd-c2c6-5271-96e7-009a87ff44bf}), fix the 'pick a default profile' logic, and then remove it from the defaults.json.

If the same thing is done for CMD, then I guess the risk appears of how to handle the case that there are no profiles available, where right now I guess you always have those two profiles, even if somehow they are not usable.

Originally created by @TBBle on GitHub (Apr 23, 2020). # Description of the new feature/enhancement It'd be nice if the "Windows PowerShell" profile worked like the other profiles, and could be disabled using `disabledProfileSources`. This would remove the need to carry a 'hidden' overriding profile per #5459, as `disabledProfileSources` made possible for the other profile sources. # Proposed technical implementation details (optional) I _guess_ it just needs new `IDynamicProfileGenerator` implementation, that replaces (and slurps up?) the existing Windows PowerShell profile if present, which appears to have a fixed GUID (`{61c54bbd-c2c6-5271-96e7-009a87ff44bf}`), fix the 'pick a default profile' logic, and then remove it from the defaults.json. If the same thing is done for CMD, then I guess the risk appears of how to handle the case that there are _no_ profiles available, where right now I guess you always have those two profiles, even if somehow they are not usable.
claunia added the Help WantedArea-SettingsIssue-TaskProduct-Terminal labels 2026-01-31 01:07:31 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 23, 2020):

Before I get to triaging this for real, just wanted to throw out a comment;

even if somehow they are not usable.

If powershell and cmd are not usable on your machine, you are in a very sorry state. Many things on your system will cease to function. I'm not sure this is a reasonable state to be in. 😄

@DHowett-MSFT commented on GitHub (Apr 23, 2020): Before I get to triaging this for real, just wanted to throw out a comment; > even if somehow they are not usable. If powershell and cmd are not usable on your machine, you are in a very sorry state. Many things on your system will cease to function. I'm not sure this is a reasonable state to be in. :smile:
Author
Owner

@DHowett-MSFT commented on GitHub (May 1, 2020):

You know, I thought I hated this. I actually don't think I do, which ... makes me somewhat sad. 😆

My stance was always that Windows PowerShell is a windows inbox application, which means we don't need to produce it with a dynamic profile generator. We wanted there to always be a reasonable default so that it would take real effort to get Terminal into a state where it doesn't have any profiles (suppressing all the generators, hiding them all, etc.).

I dunno. @zadjii-msft, this might actually make sense as part of the powershell generator. We can detect the Windows one, the Core ones, and we can actually include the Windows one in the sorted preferential list. I dunno.

I'm marking this one up for issue-task on the backlog, but it warrants further discussion.

@DHowett-MSFT commented on GitHub (May 1, 2020): You know, I thought I hated this. I actually don't think I do, which ... makes me somewhat sad. 😆 My stance was always that Windows PowerShell is a _windows inbox application_, which means we don't need to produce it with a dynamic profile generator. We wanted there to _always_ be a reasonable default so that it would take real effort to get Terminal into a state where it doesn't have any profiles (suppressing all the generators, hiding them all, etc.). I dunno. @zadjii-msft, this might actually make sense as part of the powershell generator. We can detect the Windows one, the Core ones, and we can actually include the Windows one in the sorted preferential list. I dunno. I'm marking this one up for issue-task on the backlog, but it warrants further discussion.
Author
Owner

@TBBle commented on GitHub (May 10, 2020):

I think the same idea applies to the CMD profile. To me, the big advantage of this is consistency in how you manage profiles, both disabling and for when we get #3818 to support overriding.

The flag for me was that there was necessary clarifying around the behaviour of source in a profile, but that set of rationales and behaviours can't be applied to the two "in-box" shells, even (especially) when you're in the position that those two shells are no longer interesting to be run directly in a terminal.

@TBBle commented on GitHub (May 10, 2020): I think the same idea applies to the CMD profile. To me, the big advantage of this is consistency in how you manage profiles, both disabling and for when we get #3818 to support overriding. The flag for me was that there was [necessary clarifying around the behaviour of `source` in a profile](https://github.com/microsoft/terminal/issues/5490#issuecomment-618614018), but that set of rationales and behaviours can't be applied to the two "in-box" shells, even (especially) when you're in the position that those two shells are no longer interesting to be run directly in a terminal.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7569