Skip to content

Add support for "fragment extensions" - #7632

Merged
46 commits merged into
mainfrom
dev/pabhoj/proto_ext
Feb 19, 2021
Merged

46 commits merged into
mainfrom
dev/pabhoj/proto_ext

Conversation

@PankajBhojwani

@PankajBhojwani PankajBhojwani commented Sep 14, 2020 •

Copy link
Copy Markdown
Contributor

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 Mike Griese (zadjii-msft) left a comment

Copy link
Copy Markdown
Member

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 Dustin L. Howett (DHowett) changed the title Proto extensions Add support for "fragment extensions" Feb 19, 2021

Copy link
Copy Markdown
Member

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 Dustin L. Howett (DHowett) added the AutoMerge Marked for automatic merge by the bot when requirements are met label Feb 19, 2021
@ghost

Copy link
Copy Markdown

Hello Dustin L. Howett (@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
Copy Markdown

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

Handy links:

@damnskippy

Copy link
Copy Markdown

PankajBhojwani Mike Griese (@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
Copy Markdown
Member

Pretty sure it has to be something like

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

@damnskippy

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

@zadjii-msft

Mike Griese (zadjii-msft) commented Mar 8, 2021 •

Copy link
Copy Markdown
Member

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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

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

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

@NatoBoram

Copy link
Copy Markdown

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