Unlisted Powershell entry in Windows Terminal #9597

Closed
opened 2026-01-31 01:58:46 +00:00 by claunia · 6 comments
Owner

Originally created by @Fooughhy on GitHub (Jul 13, 2020).

Environment

Windows build number: 10.0.19041.0
Windows Terminal version (if applicable): 1.0.1811.0

Any other software?

Steps to reproduce

Unfortunately, I do not know how to reproduce this...

Expected behavior

Any powershell instance not present in the "settings.json" file should not be selectable in the dropdown for a new tab in the Windows Terminal window.

Actual behavior

I have 5 profiles in my "settings.json" file (Powershell7, cmd, Git-Bash, WSL and a hidden Azure). These all show up in the dropdown of the Windows Terminal window when creating a new tab. Recently, another profile is visible in the dropdown for another Powershell version. This has not always been the case. This profile is not present in the "settings.json" file, so I am unable to hide it. My regular powershell is called "PowerShell" in the images below, while the new one is "Windows PowerShell". I have noticed that profiles get added automatically sometimes to the "settings.json" file, so I would expect the same to happen for this one, but it hasn't. Can I easily add it myself? I am uncertain how to get the "guid" value for that one though.

WindowsTerminal_xMypS4Jo2b
WindowsTerminal_TR8sbq0Op3
atom_8Sjrtj71Ev
WindowsTerminal_7RdsdFIwF5

Originally created by @Fooughhy on GitHub (Jul 13, 2020). # Environment ```none Windows build number: 10.0.19041.0 Windows Terminal version (if applicable): 1.0.1811.0 Any other software? ``` # Steps to reproduce Unfortunately, I do not know how to reproduce this... # Expected behavior Any powershell instance not present in the "settings.json" file should not be selectable in the dropdown for a new tab in the Windows Terminal window. # Actual behavior I have 5 profiles in my "settings.json" file (Powershell7, cmd, Git-Bash, WSL and a hidden Azure). These all show up in the dropdown of the Windows Terminal window when creating a new tab. Recently, another profile is visible in the dropdown for another Powershell version. This has not always been the case. This profile is not present in the "settings.json" file, so I am unable to hide it. My regular powershell is called "PowerShell" in the images below, while the new one is "Windows PowerShell". I have noticed that profiles get added automatically sometimes to the "settings.json" file, so I would expect the same to happen for this one, but it hasn't. Can I easily add it myself? I am uncertain how to get the "guid" value for that one though. ![WindowsTerminal_xMypS4Jo2b](https://user-images.githubusercontent.com/6977416/87320628-6f4ffc80-c52b-11ea-8e55-7d96c9ad85c4.png) ![WindowsTerminal_TR8sbq0Op3](https://user-images.githubusercontent.com/6977416/87320749-99092380-c52b-11ea-9b13-6869c9eaf28a.png) ![atom_8Sjrtj71Ev](https://user-images.githubusercontent.com/6977416/87320753-99a1ba00-c52b-11ea-9ba6-dfcac4874837.png) ![WindowsTerminal_7RdsdFIwF5](https://user-images.githubusercontent.com/6977416/87320756-9a3a5080-c52b-11ea-8155-0b3adddf8191.png)
Author
Owner

@zadjii-msft commented on GitHub (Jul 15, 2020):

The "Windows Powershell" profile is one of the two "default" profiles that exist for all users automatically. If you want to remove it from your list of profiles, you need to use the "hidden": true property, like so:

    "profiles":
    [
        {
            // This is the "Windows Powershell" GUID
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "hidden": true
        }
    ]
@zadjii-msft commented on GitHub (Jul 15, 2020): The "Windows Powershell" profile is one of the two "default" profiles that exist for all users automatically. If you want to remove it from your list of profiles, you need to use the `"hidden": true` property, like so: ```jsonc "profiles": [ { // This is the "Windows Powershell" GUID "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "hidden": true } ] ```
Author
Owner

@Fooughhy commented on GitHub (Jul 15, 2020):

Ok, thank you for that!

Just wondering, am I wrong in expecting that default profile to be automatically added to the sdöettibgs file? And also, am I wrong when I said profiles are added automatically at all?

@Fooughhy commented on GitHub (Jul 15, 2020): Ok, thank you for that! Just wondering, am I wrong in expecting that default profile to be automatically added to the sdöettibgs file? And also, am I wrong when I said profiles are added automatically at all?
Author
Owner

@zadjii-msft commented on GitHub (Jul 15, 2020):

This is a bit of a tricky case - "Command Prompt" and "Windows Powershell" are defined in the defaults.json file, so they're always included. Then there are other profiles, like WSL distros and other versions of powershell, which are "dynamically generated" - we'll insert them into the settings file if we detect them as installed on the system, but they're not necessarily defined in defaults.json. There's a little more info here in the docs.

@zadjii-msft commented on GitHub (Jul 15, 2020): This is a bit of a tricky case - "Command Prompt" and "Windows Powershell" are defined in the `defaults.json` file, so they're _always_ included. Then there are other profiles, like WSL distros and other versions of powershell, which are "dynamically generated" - we'll insert them into the settings file if we detect them as installed on the system, but they're not necessarily defined in `defaults.json`. There's a little more info [here](https://docs.microsoft.com/en-us/windows/terminal/dynamic-profiles) in the docs.
Author
Owner

@Fooughhy commented on GitHub (Jul 15, 2020):

Thanks again for clarifying, but it seems to me (I could definitely be wrong) that you are explaining something that isn't happening for me. The default "Windows Powershell" isn't added to my settings.json file, so I cannot (simply) change the "hidden" field to true. I understand the the profile is supposed to be in this "defaults.json" file, and I am guessing I copy the profile from there, for isn't it supposed to be added to the settings.json file automatically too?

@Fooughhy commented on GitHub (Jul 15, 2020): Thanks again for clarifying, but it seems to me (I could definitely be wrong) that you are explaining something that isn't happening for me. The default "Windows Powershell" isn't added to my settings.json file, so I cannot (simply) change the "hidden" field to true. I understand the the profile is supposed to be in this "defaults.json" file, and I am guessing I copy the profile from there, for isn't it supposed to be added to the settings.json file automatically too?
Author
Owner

@zadjii-msft commented on GitHub (Jul 15, 2020):

Sorry for the confusion, this is definitely one of the weirder edge cases in the Terminal. Since the Windows Powershell profile is listed in defaults.json, it's not going to always get re-added to your settings.json file, even if it exists. You'll have to manually add an entry (with the same guid) to be able to hide it. It's not a "dynamic" profile like the WSL ones, which will get re-added to the file. It's a "default" profile that always exists.

@zadjii-msft commented on GitHub (Jul 15, 2020): Sorry for the confusion, this is definitely one of the weirder edge cases in the Terminal. Since the Windows Powershell profile is listed in `defaults.json`, it's not going to always get re-added to your `settings.json` file, even if it exists. You'll have to manually add an entry (with the same guid) to be able to hide it. It's not a "dynamic" profile like the WSL ones, which _will_ get re-added to the file. It's a "default" profile that _always_ exists.
Author
Owner

@Fooughhy commented on GitHub (Jul 15, 2020):

Thank you so much for the explanation again! I've fixed it now, and it was as simple as you said.

@Fooughhy commented on GitHub (Jul 15, 2020): Thank you so much for the explanation again! I've fixed it now, and it was as simple as you said.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#9597