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

Add additional PowerShell Core paths (preview, scoop, etc.) to dynamic profile generator #2300

Closed
MaximoTrinidad opened this issue Aug 6, 2019 · 16 comments · Fixed by #4273
Assignees
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@MaximoTrinidad
Copy link

MaximoTrinidad commented Aug 6, 2019

depends on #754


Description of the new feature/enhancement

To include PowerShell 7 Preview.2 in the list of consoles if is already installed in the system.

I got both PowerShell Core GA and Preview installed for some time. And, the last few updates of Windows Terminal, is not automatically showing in the console list.

WinTerm_01_2019-08-06_15-40-58

WinTerm_02_2019-08-06_15-40-58

WinTerm_03_2019-08-06_15-40-58

@MaximoTrinidad MaximoTrinidad added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 6, 2019
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Aug 6, 2019
@DHowett-MSFT
Copy link
Contributor

We should handle this as part of a powershell core dynamic profile generator!

@DHowett-MSFT
Copy link
Contributor

Therefore, I am converting this issue to be the master task for "Switch PSCore to a dynamic profile generator".

@DHowett-MSFT DHowett-MSFT changed the title Feature Request to include PowerShell Preview in the list of consoles. Switch PowerShell Core to a dynamic profile generator Aug 8, 2019
@DHowett-MSFT DHowett-MSFT added Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Aug 8, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 8, 2019
@DHowett-MSFT DHowett-MSFT added Needs-Tag-Fix Doesn't match tag requirements and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 8, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Aug 8, 2019
@zadjii-msft zadjii-msft self-assigned this Aug 22, 2019
@zadjii-msft zadjii-msft added this to the Terminal 1909 milestone Aug 22, 2019
@DHowett-MSFT
Copy link
Contributor

@zadjii-msft - thoughts:

  • Should this stay open? If so:
    • Move out from 1909
    • Make it generate a bunch of different PSCore profiles
    • Add support for scoop?
    • integrate the preview icon, detect preview versions
    • make pscore {latest} the default version

@zadjii-msft
Copy link
Member

Eh, yea this should probably be re-purposed for those things.

Frankly I don't know enough about PSCore to implement preview, scoop, etc. support myself, but I'm sure that an enterprising community member could always update the PowershellCoreProfileGenerator if they wanted to add additional search locations 😜

@zadjii-msft zadjii-msft removed their assignment Sep 19, 2019
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label Sep 19, 2019
@zadjii-msft zadjii-msft changed the title Switch PowerShell Core to a dynamic profile generator Add additional PowerShell Core paths (preview, scoop, etc.) to dynamic profile generator Sep 19, 2019
@DHowett-MSFT
Copy link
Contributor

I'm taking a crack at this!

image

@DHowett-MSFT
Copy link
Contributor

The "latest good" (determined by a sorting algorithm ;P) one gets the legacy "Powershell Core" GUID :)

        // Total sort order:
        // 6-preview (wow) < 6-preview (native) < 7-preview (native) < 6 (wow) < 6 (native) < 7 (native)
        uint8_t Radix() const
        {
            return (preview ? 0b00000000 : 0b10000000) | ((majorVersion - 6) << 4) | (nativeArchitecture ? 0b1000 : 0x0000);
        }

@DHowett-MSFT DHowett-MSFT removed the Help Wanted We encourage anyone to jump in on these. label Sep 24, 2019
@DHowett-MSFT
Copy link
Contributor

@SteveL-MSFT quick questions I wanted to run by you, all related to powershell branding.

When we're generating automatic profiles for Powershell instances:

  • Should we include any version numbers past the first? (6, 6.2, 6.2.3)
  • Should we use the casing PowerShell or Powershell?
  • Should we use the name PowerShell or PowerShell Core?
    • I've implemented it as follows:
      • 6.x = "PowerShell Core"
      • 7+ = "PowerShell"
  • Is it safe for us to assume that assets\ will always be present in the powershell distribution directory?
  • If the user has installed pwsh as a dotnet global tool, should we prefer that over or under the Program Files one?

Right now, my total global sort order is this:

7 (x64/arm64 native)
6 (x64/arm64 native)
6 (x86)
7-preview (x64/arm64 native)
6-preview (x64/arm64 native)
6-preview (x86)

I'm not sure where to slot "program files", "dotnet global" and "windows store" to the sort order. 😄

@shanselman
Copy link
Member

@DHowett-MSFT Casing is "PowerShell" always. I wouldn't show version numbers. You're saying "Core" is dropped after 7 is released? I'd prefer the pwsh.exe that is first in the path.

@SteveL-MSFT
Copy link
Member

From a branding perspective, I would suggest differentiating:

  • PowerShell Core 6.1
  • PowerShell Core 6.2
  • PowerShell 7
  • PowerShell 7-Preview

(6.0 is out of support already)

I don't think 6.x-Preview is needed since we have stable releases of those and no more previews for 6.x ever.

@ghost ghost added the In-PR This issue has a related PR label Jan 17, 2020
@ghost ghost closed this as completed in #4273 Jan 31, 2020
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Jan 31, 2020
ghost pushed a commit that referenced this issue Jan 31, 2020
…4273)

This pull request teaches the PowerShell Core generator about a bunch of different locations in which it might find a PowerShell.

These instances will be sorted, a leader will be elected, and that leader will be promoted and given the vaunted title of "PowerShell".

Names will be generated for the rest.

The sort order is documented in the comments, but that comment will be replicated here:

```
// <-- Less Valued .................................... More Valued -->
// |                 All instances of PS 6                 | All PS7  |
// |          Preview          |          Stable           | ~~~      |
// |  Non-Native | Native      |  Non-Native | Native      | ~~~      |
// | Trd  | Pack | Trd  | Pack | Trd  | Pack | Trd  | Pack | ~~~      |
// (where Pack is a stand-in for store, scoop, dotnet, though they have their own orders,
// and Trd is a stand-in for "Traditional" (Program Files))
```

Closes #2300
@davidfowl
Copy link

image

After doing this it doesn't appear in the list of profiles... Am I missing something?

@DHowett-MSFT
Copy link
Contributor

Unless you’re running the latest internal-to-microsoft build that was released last night around midnight, you’re missing a version of Windows Terminal that actually has this feature in it 😅

@DHowett-MSFT
Copy link
Contributor

(If you aren’t: check the store for updates, then hit me back!)

@MaximoTrinidad
Copy link
Author

Windows Terminal version 0.8.10261.0

My dilemma has been that I want to use Windows Terminal with both PowerShell GA and Preview versions. But it seems that I can't, as it only pick one of the installed version.

WinTerm_01_2020-02-01_15-20-06

If I remove the GA version, then it grabs the Preview:

WinTerm_02_2020-02-01_15-20-06

@DHowett-MSFT
Copy link
Contributor

Well yes, again, this is because you’re using a released version of Terminal that predates this feature being added and this bug being closed. That is how we handle all bugs in this repository: they are closed when the code change is made, and an announcement is posted when a release is available that contains the change.

@MaximoTrinidad
Copy link
Author

Thank You All for your hard work! I love Windows Terminal.

@ghost
Copy link

ghost commented Feb 13, 2020

🎉This issue was addressed in #4273, which has now been successfully released as Windows Terminal Preview v0.9.433.0.:tada:

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Task It's a feature request, but it doesn't really need a major design. Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants