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

Proto extensions spec #7584

Merged
29 commits merged into from
Nov 5, 2020
Merged

Proto extensions spec #7584

29 commits merged into from
Nov 5, 2020

Conversation

PankajBhojwani
Copy link
Contributor

Summary of the Pull Request

Proto-extensions spec

PR Checklist

  • Is documentation
  • I work here
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx


Opening a profile causes its commandline argument to be automatically run. Thus, if malicious modifications are made
to existing profiles or new profiles with malicious commandline arguments are added, users could be tricked into running
things they do not want to.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could already happen even now though (someone could replace the settings file), so I don't think this adds that much risk

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I'm confused by the process of a creator making a stub, and a user choosing to import it. What changes are we making to the settings.json? What changes can users make on top of those changes to the settings.json?

doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Show resolved Hide resolved
@ghost ghost added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 9, 2020
@ghost ghost removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Sep 9, 2020
@PankajBhojwani PankajBhojwani marked this pull request as ready for review September 11, 2020 19:42
@PankajBhojwani PankajBhojwani changed the title Proto extensions spec (draft) Proto extensions spec Sep 11, 2020
Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few outstanding comments. Much clearer now, thank you!

doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
doc/specs/Proto extensions-spec.md Outdated Show resolved Hide resolved
}
```

This stub will *not* show up in the users settings file, similar to the way our default colour schemes do not show up.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(thinking out loud, not necessarily for the spec) This'll be interesting for the Settings UI, because it's valid to reference this color scheme, but not modify it. The Color Schemes page may have to either...

  • remove ColorSchemes from stubs
  • present them, but put a note that it's imported and not modifiable
  • present them, but when the user modifies one, the modified version gets copied to the settings.json

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the current colour schemes we have show up in the settings file though, how does the settings UI deal with those?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. So GlobalAppSettings currently has a reference to all of the color schemes. This can't be changed because that's how we look up what a color scheme name actually maps to. The Settings UI reads/edits that instead of the actual JSON directly.

So instead, we need a way to mark where each color scheme came from (like source in Profile). That way, when the Settings UI presents the Color Schemes page, we handle stub-generated color schemes differently (the list of ideas above).

We could also introduce another top-level navigation item that lets users browse/copy/modify anything generated from stubs. But I'm less of a fan of that idea because it breaks up where all of the color schemes can be found.

doc/specs/Proto extensions-spec.md Show resolved Hide resolved
@ghost ghost added Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Sep 11, 2020
@DHowett
Copy link
Member

DHowett commented Oct 16, 2020

@sirredbeard hey! this is related to the discussion we had about multipass being able to produce Windows Terminal profiles at runtime. Do you want to loop a couple people in to see if it fits their needs? review link here

@zadjii-msft
Copy link
Member

Hey I know I already signed off on this, however, what if an application wanted to be able to add actions? Could we also allow applications to add commands?

@PankajBhojwani
Copy link
Contributor Author

Hey I know I already signed off on this, however, what if an application wanted to be able to add actions? Could we also allow applications to add commands?

Implementation wise it'll probably just be one more list in the json file we will have to layer, but I'm a little uneasy about allowing commands because that is directly workflow-related.

Maybe we treat commands similar to colour schemes? I.e. we allow additions of new ones but no modifications to the existing ones.

@zadjii-msft
Copy link
Member

Maybe we treat commands similar to colour schemes? I.e. we allow additions of new ones but no modifications to the existing ones.

That seems reasonable to me. I suppose this was more of a showerthought - we should probably combine that showerthought into the design for "global action IDs" #6899/#7175. Maybe they can create new actions with new unique IDs, but not update existing IDs? Then, users will be able to bind those actions to keybindings using the IDs the extension app set.

Feel free to ship this spec without it and follow up separately

@PankajBhojwani
Copy link
Contributor Author

Feel free to ship this spec without it and follow up separately

Yeah as its not much of a design change with regards to proto extensions, I'd much rather ship this and #7632 first, work the kinks out, and then add actions as an additional feature

@microsoft-github-updates microsoft-github-updates bot changed the base branch from master to main October 22, 2020 00:27
@DHowett
Copy link
Member

DHowett commented Oct 27, 2020

@malxau as somebody who offers a 3p shell that might want to carry some Terminal configuration (optionally) does this read as reasonable to you? The long/short of it is that a non-Terminal party could drop a JSON fragment expressing profile details (commandline, color scheme, etc.) that'll get picked up by Terminal on next launch. review link here

@malxau
Copy link
Contributor

malxau commented Oct 28, 2020

@DHowett I'll try to read this in more detail tomorrow, but at least superficially, this looks wonderful.

(One of the problems I've had is the color palette. The colors I used looked fine in the traditional palette, but don't look so good on newer defaults. So being able to drop a JSON file that adds a profile entry, points to wherever binaries are, and defaults to a palette that works with the colors in use makes a lot of sense. Obviously the user has the last say in all of these things in the end, it's just providing straightforward defaults.)

@sirredbeard
Copy link

I am catching up on this now and circulating among our teams internally.

@PankajBhojwani PankajBhojwani added the AutoMerge Marked for automatic merge by the bot when requirements are met label Nov 5, 2020
@ghost
Copy link

ghost commented Nov 5, 2020

Hello @PankajBhojwani!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 015675d into main Nov 5, 2020
@ghost ghost deleted the dev/pabhoj/proto_spec branch November 5, 2020 21:43
@PankajBhojwani
Copy link
Contributor Author

@msftbot merge this in 27 hours

@ghost
Copy link

ghost commented Nov 5, 2020

Hello @PankajBhojwani!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Sat, 07 Nov 2020 00:43:38 GMT, which is in 1 day and 3 hours

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@DHowett
Copy link
Member

DHowett commented Nov 5, 2020

OOP

ghost pushed a commit that referenced this pull request Feb 19, 2021
Support for fragment extensions, according to the implementation
outlined in #7584 (which calls them proto extensions.)

See #7584 for more information.

## Validation Steps Performed
Self-testing by creating the folder 
`%LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments`
and adding a json file into it to modify and add profiles

Also self-tested with an app extension

Closes #1690
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Docs It's a documentation issue that really should be on MicrosoftDocs/Console-Docs Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants