VS devshell generator should prefer using powershell core if available #15402

Open
opened 2026-01-31 04:37:37 +00:00 by claunia · 4 comments
Owner

Originally created by @LuanVSO on GitHub (Sep 30, 2021).

moved from https://github.com/microsoft/terminal/pull/11326#issuecomment-930690887

Description of the new feature/enhancement

use pwsh for the devshell command on the visual studio generators

Originally created by @LuanVSO on GitHub (Sep 30, 2021). moved from https://github.com/microsoft/terminal/pull/11326#issuecomment-930690887 # Description of the new feature/enhancement use pwsh for the devshell command on the visual studio generators
claunia added the Help WantedArea-SettingsIssue-TaskProduct-Terminal labels 2026-01-31 04:37:37 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Sep 30, 2021):

Now this one's tricky - we can be sure that powershell.exe is installed. We can't be sure that a version of pwsh.exe is. We'd have to have the Visual Studio generators rely on the same powershell core detection as the powershell core generator. I don't really want to have a hard dependency from one generator on the output of another generator - they should be able to exist independently. We can re-use the code, but let's not plumb the literal Profiles from one generator to the next.

I'm sure @heaths will have thoughts on the matter.

@zadjii-msft commented on GitHub (Sep 30, 2021): Now this one's tricky - we can be sure that `powershell.exe` is installed. We _can't_ be sure that a version of `pwsh.exe` is. We'd have to have the Visual Studio generators rely on the same powershell core detection as the powershell core generator. I don't really want to have a hard dependency from one generator on the output of another generator - they should be able to exist independently. We can re-use the code, but let's not plumb the literal `Profile`s from one generator to the next. I'm sure @heaths will have thoughts on the matter.
Author
Owner

@heaths commented on GitHub (Sep 30, 2021):

The shortcuts installed by Visual Studio use Windows PowerShell. Some cmdlets on Windows they may rely on e.g. AppX also only work on Windows PowerShell. I don't think it'd be appropriate to assume support for Dev Shell on PowerShell (Core). Users could configure this otherwise, but I don't think Terminal should do so automatically, thus implying support where there is none.

@heaths commented on GitHub (Sep 30, 2021): The shortcuts installed by Visual Studio use Windows PowerShell. Some cmdlets on Windows they may rely on e.g. AppX also only work on Windows PowerShell. I don't think it'd be appropriate to assume support for Dev Shell on PowerShell (Core). Users could configure this otherwise, but I don't think Terminal should do so automatically, thus implying support where there is none.
Author
Owner

@heaths commented on GitHub (Sep 30, 2021):

That said, if we did want to support this - and we'd need to talk with the VC team to be sure that's okay (I'll start an internal thread) - we could refactor out the powershell/pwsh look-up and use that; however, I do worry about the overall startup perf of WT. Perhaps we can cache (statics or whatever) that lookup. So we wouldn't be depending directly on the PowerShell generator, though the brunt of it.

It does raise another issue in my head, though, and perhaps worth of another issue: WT startup perf gets worse with each new generator. Should we have a way to turn them off (do we read the config early enough?) or even run them every X days or something? Or is the thought here (and telemetry to back it up) most people start WT once in a while and just let it run (I do, but that's anecdotal).

@heaths commented on GitHub (Sep 30, 2021): That said, if we did want to support this - and we'd need to talk with the VC team to be sure that's okay (I'll start an internal thread) - we could refactor out the powershell/pwsh look-up and use that; however, I do worry about the overall startup perf of WT. Perhaps we can cache (statics or whatever) that lookup. So we wouldn't be depending directly on the PowerShell generator, though the brunt of it. It does raise another issue in my head, though, and perhaps worth of another issue: WT startup perf gets worse with each new generator. Should we have a way to turn them off (do we read the config early enough?) or even run them every X days or something? Or is the thought here (and telemetry to back it up) most people start WT once in a while and just let it run (I do, but that's anecdotal).
Author
Owner

@zadjii-msft commented on GitHub (Sep 30, 2021):

Should we have a way to turn them off (do we read the config early enough?

We do, disabledProfileSources. They only run when a window is started (or the settings are hot-reloaded)

@zadjii-msft commented on GitHub (Sep 30, 2021): > Should we have a way to turn them off (do we read the config early enough? We do, `disabledProfileSources`. They only run when a window is started (or the settings are hot-reloaded)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#15402