profiles.defaults should be default values, not override values, or make a new section for overridable defaults #17174

Closed
opened 2026-01-31 05:34:18 +00:00 by claunia · 11 comments
Owner

Originally created by @DJackman123 on GitHub (Apr 6, 2022).

Originally assigned to: @lhecker on GitHub.

The current implementation of Terminal applies the settings found in profiles.default to all profiles, regardless of whether the individual profile has its own value for any of those settings. Unfortunately, this behavior is unexpected and confusing. The only reasoning I can come up with is that profiles.default was meant to override settings from automatic profiles that aren't defined in settings.json at all. For profiles defined in settings.json, the expectation for profiles.default would be that any setting not defined in an individual profile would get its value from profiles.default, but if a setting is provided in the individual profile the corresponding setting in profiles.default would be ignored.

Please change Terminal so profiles.default behaves in an expected way, providing default values and not override values. If an overriding section is really needed, then create a new profiles.overrides section for this. With the current implementation, it is not possible to define several profiles and have most of them use a common value for some settings, while one or two exception profiles do something different without copying that setting to every individual profile. profiles.default has very little value when it forces itself onto every profile.
If profiles.default can't change for some reason, then consider creating a new section (maybe profiles.fallback) for overridable defaults or fallback values that individual profiles can override if they provide a value for that setting in the profile.

Originally created by @DJackman123 on GitHub (Apr 6, 2022). Originally assigned to: @lhecker on GitHub. The current implementation of Terminal applies the settings found in profiles.default to all profiles, regardless of whether the individual profile has its own value for any of those settings. Unfortunately, this behavior is unexpected and confusing. The only reasoning I can come up with is that profiles.default was meant to override settings from automatic profiles that aren't defined in settings.json at all. For profiles defined in settings.json, the expectation for profiles.default would be that any setting not defined in an individual profile would get its value from profiles.default, but if a setting *is* provided in the individual profile the corresponding setting in profiles.default would be ignored. Please change Terminal so profiles.default behaves in an expected way, providing default values and not override values. If an overriding section is really needed, then create a new profiles.overrides section for this. With the current implementation, it is not possible to define several profiles and have most of them use a common value for some settings, while one or two exception profiles do something different without copying that setting to every individual profile. profiles.default has very little value when it forces itself onto every profile. If profiles.default can't change for some reason, then consider creating a new section (maybe profiles.fallback) for overridable defaults or fallback values that individual profiles can override if they provide a value for that setting in the profile.
Author
Owner

@zadjii-msft commented on GitHub (Apr 6, 2022):

What version are you on? Could you share a settings snippet that repros what you're seeing?

In general, settings from profiles.defaults should override ones from dynamic profiles (e.g. WSL distros) and fragments (like, customizations that Canonical does to their WSL distro), but not ones from the rest of your settings file (the rest of the profiles in profiles.list)

@zadjii-msft commented on GitHub (Apr 6, 2022): What version are you on? Could you share a settings snippet that repros what you're seeing? In general, settings from `profiles.defaults` should override ones from dynamic profiles (e.g. WSL distros) and fragments (like, customizations that Canonical does to their WSL distro), but not ones from the rest of your settings file (the rest of the profiles in `profiles.list`)
Author
Owner

@DHowett commented on GitHub (Apr 6, 2022):

Agree on the above^
The thing you've described as the expected behavior is how profiles.defaults works:

image
@DHowett commented on GitHub (Apr 6, 2022): Agree on the above^ The thing you've described as the expected behavior _is how `profiles.defaults` works_: <img width="593" alt="image" src="https://user-images.githubusercontent.com/189190/162022748-2b6c1bbd-54fd-4a1d-bd9c-31436ab27505.png">
Author
Owner

@DJackman123 commented on GitHub (Apr 6, 2022):

Is that true for all settings? It sure doesn't seem to be how commandLine behaves.

@DJackman123 commented on GitHub (Apr 6, 2022): Is that true for all settings? It sure doesn't seem to be how commandLine behaves.
Author
Owner

@DHowett commented on GitHub (Apr 6, 2022):

Settings are case-sensitive; are you overriding commandline with commandLine?

image
@DHowett commented on GitHub (Apr 6, 2022): Settings are case-sensitive; are you overriding `commandline` with `commandLine`? <img width="742" alt="image" src="https://user-images.githubusercontent.com/189190/162023340-ee6b116d-6642-4d56-8302-95068e3ef063.png">
Author
Owner

@zadjii-msft commented on GitHub (Apr 6, 2022):

image

did you set commandline or commandLine (with a capital L)?

@zadjii-msft commented on GitHub (Apr 6, 2022): ![image](https://user-images.githubusercontent.com/18356694/162023304-9efedb5e-33c0-4488-9b45-f96c655e309d.png) did you set `commandline` or `commandLine` (with a capital `L`)?
Author
Owner

@DJackman123 commented on GitHub (Apr 6, 2022):

No, that was just a typo in this issue. My settings are correct.
Now join me on the path to weirdness...
Did some experimentation with this and found that it isn't working for me because I am referencing cmd.exe and powershell.exe without a path (since they are in the system path). If I change the commandline value to include the path, then it works. It doesn't matter if the commandline value under defaults has a path or not.

This profile definition will use pwsh.exe for both profiles, but if you switch to the commented-out commandline values, it will work.

    "profiles": 
    {
        "defaults":
        {
            "commandline": "pwsh.exe"
        },
        "list": 
        [
            {
                // "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
                "commandline": "powershell.exe",
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "hidden": false,
                "name": "Windows PowerShell"
            },
            {
                // "commandline": "%SystemRoot%\\System32\\cmd.exe",
                "commandline": "cmd.exe",
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "hidden": false,
                "name": "Command Prompt"
            }
        ]
    }

So this is sounding more like a bug to me.

@DJackman123 commented on GitHub (Apr 6, 2022): No, that was just a typo in this issue. My settings are correct. Now join me on the path to weirdness... Did some experimentation with this and found that it isn't working for me because I am referencing cmd.exe and powershell.exe without a path (since they are in the system path). If I change the commandline value to include the path, then it works. It doesn't matter if the commandline value under defaults has a path or not. This profile definition will use pwsh.exe for both profiles, but if you switch to the commented-out commandline values, it will work. ``` "profiles": { "defaults": { "commandline": "pwsh.exe" }, "list": [ { // "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", "commandline": "powershell.exe", "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "hidden": false, "name": "Windows PowerShell" }, { // "commandline": "%SystemRoot%\\System32\\cmd.exe", "commandline": "cmd.exe", "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "hidden": false, "name": "Command Prompt" } ] } ``` So this is sounding more like a bug to me.
Author
Owner

@DHowett commented on GitHub (Apr 6, 2022):

Frick. I might have been the killer -- through @zadjii-msft's hands. ba37cd0259 (r783387620)

@DHowett commented on GitHub (Apr 6, 2022): Frick. I might have been the killer -- through @zadjii-msft's hands. https://github.com/microsoft/terminal/pull/12149/files/ba37cd0259bff7585eae1b1161657750d4629de8#r783387620
Author
Owner

@DJackman123 commented on GitHub (Apr 6, 2022):

oh, you were trying to be clever? That always gets me into trouble...

@DJackman123 commented on GitHub (Apr 6, 2022): oh, you were trying to be clever? That always gets me into trouble...
Author
Owner

@DHowett commented on GitHub (Apr 18, 2022):

Thanks for catching this, @DJackman123!

@DHowett commented on GitHub (Apr 18, 2022): Thanks for catching this, @DJackman123!
Author
Owner

@ghost commented on GitHub (May 24, 2022):

:tada:This issue was addressed in #12906, which has now been successfully released as Windows Terminal v1.13.1143.🎉

Handy links:

@ghost commented on GitHub (May 24, 2022): :tada:This issue was addressed in #12906, which has now been successfully released as `Windows Terminal v1.13.1143`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.13.1143) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (May 24, 2022):

:tada:This issue was addressed in #12906, which has now been successfully released as Windows Terminal Preview v1.14.143.🎉

Handy links:

@ghost commented on GitHub (May 24, 2022): :tada:This issue was addressed in #12906, which has now been successfully released as `Windows Terminal Preview v1.14.143`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.14.143) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#17174