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

Add support for "fragment extensions" #7632

Merged
46 commits merged into from
Feb 19, 2021
Merged

Add support for "fragment extensions" #7632

46 commits merged into from
Feb 19, 2021

Conversation

PankajBhojwani
Copy link
Contributor

@PankajBhojwani PankajBhojwani commented Sep 14, 2020

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

@PankajBhojwani PankajBhojwani marked this pull request as ready for review September 21, 2020 21:57
@PankajBhojwani PankajBhojwani changed the title [DRAFT] Proto extensions Proto extensions Sep 21, 2020
@zadjii-msft zadjii-msft self-assigned this Oct 1, 2020
Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

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

Okay I'm happy with this

@DHowett DHowett changed the title Proto extensions Add support for "fragment extensions" Feb 19, 2021
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Let's just do it!

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 19, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

Hello @DHowett!

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 654c0cc into main Feb 19, 2021
@ghost ghost deleted the dev/pabhoj/proto_ext branch February 19, 2021 02:12
@ghost
Copy link

ghost commented Mar 1, 2021

🎉Windows Terminal Preview v1.7.572.0 has been released which incorporates this pull request.:tada:

Handy links:

@damnskippy
Copy link

@PankajBhojwani @zadjii-msft I'm trying to use this feature with the latest preview release. I wanted to put all the color schemes in a separate json so as to not clutter the settings.json file. Not sure if that's valid/feasible or makes sense - let me know if it's not and I'll abandon. Reading the documentation, it's not clear to me where (path/folder) I would put this json extension file at? I believe I downloaded preview from github releases page if not from the Store - I'm not recalling with certainty now. Tried creating a file %LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\test.json but that didn't take effect as the schemes I put in there are not showing up. I'm probably doing something wrong I'm not sure. Thanks.

@zadjii-msft
Copy link
Member

Pretty sure it has to be something like

%LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\MyCoolColorSchemes\test.json.

@damnskippy
Copy link

Tried it with no luck: %LOCALAPPDATA%\Microsoft\Windows Terminal\Fragments\test\test.json.
Contents below (in case I bungled anything there):

{
  "profiles": [
  ],
  "schemes": [
    {
        {
            "name": "Test Extension",
            "background":    "#19171c",
            "foreground":    "#8b8792",
            "black":         "#19171c",
            "red":           "#be4678",
            "green":         "#2a9292",
            "yellow":        "#a06e3b",
            "blue":          "#576ddb",
            "purple":        "#955ae7",
            "cyan":          "#398bc6",
            "white":         "#8b8792",
            "brightBlack":   "#655f6d",
            "brightRed":     "#be4678",
            "brightGreen":   "#2a9292",
            "brightYellow":  "#a06e3b",
            "brightBlue":    "#576ddb",
            "brightPurple":  "#955ae7",
            "brightCyan":    "#398bc6",
            "brightWhite":   "#efecf4"
        }
    }
  ]
}

@zadjii-msft
Copy link
Member

For the record, just adding the file, or modifying fragments, won't cause a "hot reload" of the settings - you'll need to touch the settings.json file, or relaunch the terminal to get the settings from the fragment

@damnskippy
Copy link

I relaunched the terminal for a good measure but still no joy.
I'm still convinced I'm doing something wrong :)

@zadjii-msft
Copy link
Member

zadjii-msft commented Mar 8, 2021

Oh you've got one too many braces in that scheme!

{
    "profiles": [
    ],
    "schemes": [
        {
            "name": "Test Extension",
            "background":    "#19171c",
            "foreground":    "#8b8792",
            "black":         "#19171c",
            "red":           "#be4678",
            "green":         "#2a9292",
            "yellow":        "#a06e3b",
            "blue":          "#576ddb",
            "purple":        "#955ae7",
            "cyan":          "#398bc6",
            "white":         "#8b8792",
            "brightBlack":   "#655f6d",
            "brightRed":     "#be4678",
            "brightGreen":   "#2a9292",
            "brightYellow":  "#a06e3b",
            "brightBlue":    "#576ddb",
            "brightPurple":  "#955ae7",
            "brightCyan":    "#398bc6",
            "brightWhite":   "#efecf4"
        }
    ]
}

@damnskippy
Copy link

D'oh! That was it! Thanks so much for your time and kindness (and good eyes!).
As a punishment, I'm disqualifying myself from ever getting into yaml vs json debates for the next 6 months.

@NatoBoram
Copy link

Is there some docs for how to make, build and publish on the Windows Store an extension that adds a single JSON fragment?

@carlos-zamora
Copy link
Member

Is there some docs for how to make, build and publish on the Windows Store an extension that adds a single JSON fragment?

@NatoBoram Found this: https://docs.microsoft.com/en-us/windows/terminal/json-fragment-extensions
Does that help?

@NatoBoram
Copy link

Not really. This assumes I have an app where I can stick this JSON fragment, but I don't. I want to make an app that's only a JSON fragment. Once I have created a folder that contains this mysterious Package.appxmanifest and the Public/Fragments/theme.json file, how do I compile that? How do I publish it? What's the command I need to run to make this into an installable package?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extensibility A feature that would ideally be fulfilled by us having an extension model. Area-Settings Issues related to settings and customizability, for console or terminal AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Allow WSL distros and other shells to load metadata into terminal
7 participants