Dropdown menu lists profiles in wrong order; doesn't match settings.json #9821

Open
opened 2026-01-31 02:04:43 +00:00 by claunia · 0 comments
Owner

Originally created by @KalleOlaviNiemitalo on GitHub (Jul 24, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.388]
Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.2.2022.0

PowerShell 6.2.7 (PowerShell-6.2.7-win-x64.msi)
PowerShell 7.1.0-preview.5 (PowerShell-7.1.0-preview.5-win-x64.msi)
Visual Studio Professional 2017 Version 15.9.25

Steps to reproduce

Define these profiles in settings.json:

    "profiles":
    {
        "defaults":
        {
            // Put settings here that you want to apply to all profiles.
        },
        "list":
        [
            {
                "guid": "{dc9f4186-52a8-4b9f-a659-0c438c764b58}",
                "commandline": "\"%ProgramFiles%\\Git\\bin\\bash.exe\" -i -l",
                "name": "Git Bash",
                "icon": "%ProgramFiles%\\Git\\mingw64\\share\\git\\git-for-windows.ico",
                "startingDirectory": "C:\\Projects",
                "hidden": false
            },
            {
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore",
                "hidden": false
            },
            {
                "guid": "{a3a2e83a-884a-5379-baa8-16f193a13b21}",
                "name": "PowerShell 7 Preview",
                "source": "Windows.Terminal.PowershellCore",
                "hidden": true
            },
            {
                "guid": "{2595cd9c-8f05-55ff-a1d4-93f3041ca67f}",
                "name": "PowerShell Preview (msix)",
                "source": "Windows.Terminal.PowershellCore",
                "hidden": true
            },
            {
                "guid": "{049b895c-b0b8-55de-bce3-27d3220d7ab3}",
                "name": "PowerShell Core 6",
                "source": "Windows.Terminal.PowershellCore",
                "hidden": false
            },
            {
                // Make changes here to the powershell.exe profile.
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell",
                "commandline": "powershell.exe",
                "hidden": false
            },
            {
                "guid": "{9366fe6a-7c14-4115-a32b-0c59fd2cf264}",
                "commandline": "%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\Tools\\VsDevCmd.bat\"",
                "name": "Developer Command Prompt for VS 2017",
                "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
                "tabTitle": "VS2017 Dev Command Prompt",
                "hidden": false
            },
            {
                // Make changes here to the cmd.exe profile.
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "Command Prompt",
                "commandline": "cmd.exe",
                "hidden": false
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure",
                "useAcrylic": false,
                "hidden": false
            }
        ]
    },

The profiles with "hidden": true refer to PowerShell versions that are not currently installed.

Expected behavior

The dropdown menu should list the "hidden": false profiles in the same order as settings.json:

image

Actual behavior

The dropdown menu lists the profiles in a different order; Command Prompt appears between the PowerShell versions:

image

However, if I comment out the profiles that have "hidden": true, then I get the order that I expect.

Originally created by @KalleOlaviNiemitalo on GitHub (Jul 24, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: Microsoft Windows [Version 10.0.19041.388] Windows Terminal version (if applicable): Windows Terminal Preview Version: 1.2.2022.0 PowerShell 6.2.7 (PowerShell-6.2.7-win-x64.msi) PowerShell 7.1.0-preview.5 (PowerShell-7.1.0-preview.5-win-x64.msi) Visual Studio Professional 2017 Version 15.9.25 ``` # Steps to reproduce Define these profiles in settings.json: ```yaml "profiles": { "defaults": { // Put settings here that you want to apply to all profiles. }, "list": [ { "guid": "{dc9f4186-52a8-4b9f-a659-0c438c764b58}", "commandline": "\"%ProgramFiles%\\Git\\bin\\bash.exe\" -i -l", "name": "Git Bash", "icon": "%ProgramFiles%\\Git\\mingw64\\share\\git\\git-for-windows.ico", "startingDirectory": "C:\\Projects", "hidden": false }, { "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "name": "PowerShell", "source": "Windows.Terminal.PowershellCore", "hidden": false }, { "guid": "{a3a2e83a-884a-5379-baa8-16f193a13b21}", "name": "PowerShell 7 Preview", "source": "Windows.Terminal.PowershellCore", "hidden": true }, { "guid": "{2595cd9c-8f05-55ff-a1d4-93f3041ca67f}", "name": "PowerShell Preview (msix)", "source": "Windows.Terminal.PowershellCore", "hidden": true }, { "guid": "{049b895c-b0b8-55de-bce3-27d3220d7ab3}", "name": "PowerShell Core 6", "source": "Windows.Terminal.PowershellCore", "hidden": false }, { // Make changes here to the powershell.exe profile. "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false }, { "guid": "{9366fe6a-7c14-4115-a32b-0c59fd2cf264}", "commandline": "%comspec% /k \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\Common7\\Tools\\VsDevCmd.bat\"", "name": "Developer Command Prompt for VS 2017", "icon": "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png", "tabTitle": "VS2017 Dev Command Prompt", "hidden": false }, { // Make changes here to the cmd.exe profile. "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "Command Prompt", "commandline": "cmd.exe", "hidden": false }, { "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure", "useAcrylic": false, "hidden": false } ] }, ``` The profiles with `"hidden": true` refer to PowerShell versions that are not currently installed. # Expected behavior The dropdown menu should list the `"hidden": false` profiles in the same order as `settings.json`: ![image](https://user-images.githubusercontent.com/46201428/88382944-2e20dd80-cdb2-11ea-967c-20fcaf8910e7.png) # Actual behavior The dropdown menu lists the profiles in a different order; Command Prompt appears between the PowerShell versions: ![image](https://user-images.githubusercontent.com/46201428/88383083-7b04b400-cdb2-11ea-9434-f51775732023.png) However, if I comment out the profiles that have `"hidden": true`, then I get the order that I expect.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9821