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

Default Profile for Common Profile Settings #2325

Closed
damianpowell opened this issue Aug 7, 2019 · 15 comments · Fixed by #3892
Closed

Default Profile for Common Profile Settings #2325

damianpowell opened this issue Aug 7, 2019 · 15 comments · Fixed by #3892
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.
Milestone

Comments

@damianpowell
Copy link

Default Profile for Common Profile Settings

Allow settings which the user would like applied to all profiles to be specified in a profile with a well-known name, such as "name" : "_default". All settings in this profile will be applied before they are overridden from individual profiles. This would be helpful to allow all profiles to have acrylic applied with a certain opacity where those settings are not specified.

[snip]
{
    "name" : "_default",
    "useAcrylic" : true,
    "acrylicOpacity" : 0.5,
    "closeOnExit" : true,
    "colorScheme" : "Campbell",
    "cursorColor" : "#FFFFFF",
    "cursorShape" : "bar",
    "fontFace" : "Consolas",
    "fontSize" : 10,
    "historySize" : 9001,
    "padding" : "0, 0, 0, 0",
    "snapOnInput" : true,
    "startingDirectory" : "%USERPROFILE%"
},
{
    "name" : "PowerShell Core",
    "commandline" : "C:\\Program Files\\PowerShell\\6\\pwsh.exe",
    "guid" : "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "icon" : "ms-appx:///ProfileIcons/{574e775e-4f2a-5b96-ac1e-a2962a402336}.png",
},
{
    "name" : "cmd",
    "commandline" : "cmd.exe",
    "guid" : "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
    "icon" : "ms-appx:///ProfileIcons/{0caa0dad-35be-5f56-a8ff-afceeeaa6101}.png",
    "useAcrylic" : false
},
[snip]
@damianpowell damianpowell added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 7, 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 7, 2019
@mcpiroman
Copy link
Contributor

Sounds like subset of #1258 (comment)

@carlos-zamora
Copy link
Member

Tagging @zadjii-msft for ideas regarding Cascading Settings.

Personally, I think that the current spec covers this functionality in a cleaner way, but @zadjii-msft might catch something I'm missing here. :)

@carlos-zamora carlos-zamora added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. and removed Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 7, 2019
@zadjii-msft
Copy link
Member

So I'm gonna leave this open (unless there's another issue we've got already tracking this bit).

This is one of the things I refer to in the #1258 spec, but I specifically don't cover to try and keep that spec as atomic as possible. I absolutely want to be able to include a default profile to the settings that's used as the prototype for all the other profiles you might have.

This is probably something that'll be spec'd up once #754 is more ironed out.

@zadjii-msft zadjii-msft added this to the Terminal v1.0 milestone Aug 8, 2019
@DHowett-MSFT
Copy link
Contributor

@zadjii-msft this probably only needs a very light spec, if one at all. Proposal to change type to Issue-Task?

@zadjii-msft zadjii-msft added Issue-Task It's a feature request, but it doesn't really need a major design. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Sep 17, 2019
@zadjii-msft zadjii-msft self-assigned this Sep 17, 2019
@zadjii-msft
Copy link
Member

Done. I might just skip the spec tbh. I'll prototype and feel out if it really needs the spec, I think we all understand what we want from this feature.

@zadjii-msft
Copy link
Member

Let's have a discussion: Where should these settings be layered?

For defaults, dynamic profiles, should these "global default" settings be applied:

  1. _immediately after the Profile is constructed (so that settings from defaults.json and dynamic profile generators) should override them?
  2. Or after settings from defaults.json and dynamic profile generators are applied? (this feels wrong to me)
  3. Should it be after defaults.json but before DPGs?
  • Settings from dynamic profiles layer on top of "global default" settings, but "global default" settings override things from defaults.json

@microsoft/windows-console-team thoughts?


Hypothetical settings:

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "defaultSettings": 
    {
        "padding" : "2",
        "useAcrylic" : true,
        "fontFace" : "Cascadia Code",
        "icon" : "myIcon.png"
    },
    "profiles":
    [
        {
            // Make changes here to the powershell.exe profile
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "name": "Windows PowerShell",
            "commandline": "powershell.exe",
            "hidden": false
        },
        {
            // Make changes here to the cmd.exe profile
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "name": "cmd",
            "commandline": "cmd.exe",
            "hidden": false
        },
        {
            "guid": "{c6eaf9f4-32a7-5fdc-b5cf-066e8a4b1e40}",
            "hidden": false,
            "name": "Ubuntu-18.04",
            // recall that the WSL DPG sets the icon to the tux png.
            "source": "Windows.Terminal.Wsl"
        },
    ],

    "schemes": [],
    "keybindings": []
}

If we do 1, then "useAcrylic" would have no affect on the powershell, cmd default profiles, since they set "useAcrylic" themselves. Same with the padding value.

If we do 2, then the icon we set in the defaults will blow away the default cmd, powershell icons, as well as the icons set by the DPGs we currently have. However, the useAcrylic, padding settings apply correctly.

If we do 3, then the icon for the DPG still works, since it gets applied after the global defaults, but the icon for cmd, powershell is still overridden.

@DHowett-MSFT
Copy link
Contributor

2 feels right to me- how would the user say “I want Cascadia Code everywhere” if the Profile constructor or the Default profiles set it to Consolas? The user’s preferred defaults IMO trump any app generated data, so if they want to set a default icon it’s on them?

I can see why that would not be ideal.

To properly handle option 1 we would need to remove everything from defaults.json that is also matched by the constructor, and that reduces the absolute value of defaults.json.

@miniksa
Copy link
Member

miniksa commented Oct 3, 2019

If you do 3, is there any way to override the icon for the DPG or is it now toast?

I think it's either 2 or 3.

@zadjii-msft
Copy link
Member

With both 2 and 3, we can still override the icon from a DPG by setting the icon within the profile manually. The other profiles in profiles.json are always applied last, so settings from those will always override default, global, or dynamically-generated properties.

@miniksa
Copy link
Member

miniksa commented Oct 3, 2019

In that case, I think if you expressly set an icon at this user-set-defaults level, it should kill the DPG icons unless you again go further and override one of the DPGs to have an icon.

So that's a 2, I believe.

@zadjii-msft
Copy link
Member

2 it is then :)

Thanks all for the pseudo-spec review. We can debate naming in the PR, and if I run into any other issues I'll ping this thread. Though, that won't be till at least the end of the month :P

@jwhipp
Copy link

jwhipp commented Oct 8, 2019

I don't know if this is related for sure, but build 0.5.2762.0 from the store on a fresh profile resulted in a near empty settings json with only profiles information. The settings for everything else is seemingly gone.

@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Oct 8, 2019

@jwhipp That's the point! You should give a closer read to the settings file -- it explains what to do and what you should be looking for. 😄

image

@jwhipp
Copy link

jwhipp commented Oct 8, 2019

I see... my bad. My eyes immediately started scanning for the portions I wanted to edit and I didn't even notice that comment line.

@ghost ghost added the In-PR This issue has a related PR label Oct 29, 2019
@ghost ghost removed the In-PR This issue has a related PR label Nov 11, 2019
@ghost ghost added the In-PR This issue has a related PR label Dec 9, 2019
@ghost ghost closed this as completed in #3892 Dec 11, 2019
ghost pushed a commit that referenced this issue Dec 11, 2019
## Summary of the Pull Request

_This is attempt 2 at this feature_. The original PR can be found at #3369. 

These are settings that apply to _every_ profile, before user customizations. 

If the user wants to add "default profile settings", they can make the `"profiles"` property an _object_, instead of a list, and add `"defaults"` key underneath that object. The users list of profiles should then be under the `list` property of the `profiles` object.

## References
#2515, #2603, #3369, #3569

## PR Checklist
* [x] Closes #2325
* [x] I work here
* [x] Tests added/passed
* [x] schema, docs updated

## Detailed Description of the Pull Request / Additional comments
~~Discussion in #2325 itself serves as the "spec" for this task. I thought we'd need more discussion on the topic, but it ended up being pretty straightforward.~~

I should not have said that in the original PR. We've had a better spec review now that I think we're happier with.

## Validation Steps Performed
_ran the tests_
@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 Dec 11, 2019
zadjii-msft added a commit that referenced this issue Dec 11, 2019
Refer to the original issue: **Default Profile for Common Profile Settings** #2325

So this is my summary of everything we discussed regarding "default profile settings". The original PR was #3369, but we were _not_ in agreement on the UX, so this PR is for discussion about that. 

I put forth 4 proposals that were mentioned in the discussion.

In the discussion that followed, we decided the 3rd proposal was the best. The doc reflects that choice.
@ghost
Copy link

ghost commented Jan 14, 2020

🎉This issue was addressed in #3892, which has now been successfully released as Windows Terminal Preview v0.8.10091.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
8 participants