First, given the following settings, PowerShell is not hidden in the dropdown; it shows both cmd and PowerShell. This is not expected to me, as I have removed PowerShell from the profiles array.
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"profiles": [
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false
},
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": true,
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": true,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
}
],
"schemes": [],
"keybindings": []
}
Second, if I delete Ubuntu and Azure Cloud Shell...
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"profiles": [
{
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"name": "cmd",
"commandline": "cmd.exe",
"hidden": false
}
],
"schemes": [],
"keybindings": []
}
and hit save, Ubuntu and Azure Cloud Shell will be re-added automatically, but this time even with hidden: false. This is not expected to me since I have previously deleted Ubuntu and Azure Cloud Shell from the array.
Yep this is just the way profiles work.
Powershell is a default profile, so it's defined in defaults.json, which your settings are layered upon. You need to use "hidden": true, to hide that profile.
Ubuntu and Azure Cloud Shell are "dynamic" profiles - at launch we'll run some code to try and enumerate all your WSL distros, powershell core installs, etc, and add profiles on the user's behalf. That way, when the user installs a new WSL distro, it'll automatically appear in new Terminal instances.
You can read more about this in this doc or for the bold, the spec that goes into much more technical details.
Yep this is just the way profiles work.
I know that this is by design. Still, I'm saying it's a bad user experience: When I delete something, but it still shows up, then that's unexpected. I know it's subjective, but that's bad UX to me - no matter how well specc'ed the feature is.
That way, when the user installs a new WSL distro, it'll automatically appear in new Terminal instances.
That way you cannot remove those profiles. I remove one, hit save, and it's there again - as if my action never happened. Again, I know this is by design, but your design, quite frankly, is kinda annoying to me. It gives the illusion of control: _"Here's a config file, go configure your terminal! ... Oops, never mind, you can't configure that. Let me just overwrite the changes you made."_