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

How to safely update Terminal's config file with PSWinTerminal? #7146

Closed
sassdawe opened this issue Aug 1, 2020 · 3 comments
Closed

How to safely update Terminal's config file with PSWinTerminal? #7146

sassdawe opened this issue Aug 1, 2020 · 3 comments
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered

Comments

@sassdawe
Copy link

sassdawe commented Aug 1, 2020

Description of the new feature/enhancement

What is the safest way to update Terminal's config file from a command line running inside the Terminal?

I'd like to avoid colliding with your future feature updates.

Proposed technical implementation details (optional)

I published PSWinTerminal into PowerShell Gallery, which implements Get-WTTheme, Show-WTTheme, and Set-WTTheme.

And I'm planning to implement Import-WTTheme / New-WTTheme to extend the available themes.

How should I approach these cmdlets without risking breaking the configuration? Thanks!

@sassdawe sassdawe added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 1, 2020
@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 1, 2020
@sassdawe
Copy link
Author

sassdawe commented Aug 1, 2020

You can see my implementation of PSWinTerminal here

I used the available environment variables, and I have some ideas for new variables. Should I open an other issues to cover those?

@DHowett
Copy link
Member

DHowett commented Aug 21, 2020

@sassdawe Sorry to let this issue languish on our repo for so long. As somebody building on top of Terminal you almost certainly deserve better than that!

So, here's the deal.

Detecting where the settings are

Right now, we're leaving this largely up to chance. The user's settings will be in one of three (or four, if they're a terminal developer) places, and figuring out exactly which one is active is hard. We had a proposal, #4566, that would get us there. We need to have out the discussion in that one on whether we really do think it a good idea.

Editing settings safely

There's another project, MSTerminalSettings, that now uses C# code automatically generated from our settings schema. If it's possible for you to follow our schema in a similar way--I'm not sure what powershell offers in terms of JSON schema support--that would make certain that you're not breaking anything.

Otherwise, it's entirely safe to edit the user's settings and re-save them. It's a minor pain because we're "mostly JSON" with the addition of trailing commas and comments... much to the ire of some of the more steadfast JSON supporters in our community.

future

We're actively working to separate our settings model -- serializers and deserializers and all -- out into a separate component library that can operate independent of Terminal. One of our goals is to make it easier for people to edit our settings through a programmatic interface. You can follow the progress of that one in #885/#7141

@DHowett DHowett closed this as completed Aug 21, 2020
@DHowett DHowett added Issue-Question For questions or discussion Resolution-Answered Related to questions that have been answered and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. 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 21, 2020
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Aug 21, 2020
@DHowett
Copy link
Member

DHowett commented Aug 21, 2020

By the way, it's really nice to see folks writing modules that support all the weird stuff we do here. You're very much appreciated 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Question For questions or discussion Needs-Tag-Fix Doesn't match tag requirements Resolution-Answered Related to questions that have been answered
Projects
None yet
Development

No branches or pull requests

2 participants