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

Use multiple config files to separate settings that are machine-specific #11904

Closed
rbanffy opened this issue Dec 8, 2021 · 5 comments
Closed
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@rbanffy
Copy link

rbanffy commented Dec 8, 2021

Use multiple config files so that personal preferences can be split from machine-specific options

Like many people, I keep a dotfiles repo. When using multiple Windows machines, the installed WSL hosts are different and, therefore, it's not possible to share the settings.json file between multiple computers because the elements under profiles.list are different, while profiles.defaults is safe to share between computers.

I would suggest Terminal to use a second JSON file under LocalState to keep the profiles.list entries to make it easy to keep settings.json safe to share between multiple machines while keeping unrelated settings in a separate file. Also, the defaultProfile key would need to be moved into this new file, and JSON schemas should be adjusted to reflect that.

@rbanffy rbanffy added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Dec 8, 2021
@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 Dec 8, 2021
@zadjii-msft
Copy link
Member

A pile of things that are all related:

it's not possible to share the settings.json file between multiple computers because the elements under profiles.list are different

It should also mostly work. The WSL profiles the Terminal generates for you are "dynamic profiles", which means that the Termnial recognizes that those profiles come from somewhere else, which may or may not exist. So the Terminal is smart enough to hide those profiles if you were to uninstall the distro, or move the file to a machine that doesn't have that WSL distro installed. We actually used to also roam the settings.json file across machines, which was part of what necessitated such functionality.

That being said, if you add your own WSL profiles pointing at specific distros, then the Terminal isn't going to be able to figure those out for you.

Of course, you can also use fragments for this. Just create a file in:

C:\ProgramData\Microsoft\Windows Terminal\Fragments\{app-name}\{file-name}.json

({app-name} and {file-name} can be literally anything, doesn't matter)

and then put whatever machine-specific profiles you want in there.

/dup #2933

@ghost
Copy link

ghost commented Dec 8, 2021

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Dec 8, 2021
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed 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 Dec 8, 2021
@rbanffy
Copy link
Author

rbanffy commented Dec 8, 2021

Thank you for the prompt response, @zadjii-msft. I did a couple dozen searches before not finding the issues you pointed to.

It kind of works, but, in this specific case, I'm not sure the fragments approach will solve - the settings I'd like to share are not specific to a profile, but are on the profiles.defaults key (I change the font face for all profiles). I'll give it a try as soon as I get back to a Windows machine where I can test it.

In any case, having profiles and settings on separate would still be a good idea. I made a note on #641, which seems like a closer idea to this one.

@zadjii-msft
Copy link
Member

Oh I mean, so I'm thinking:

  • Leave all the settings you want on all machines in settings.json. sync that to your different devices however you want. Fill in the profiles.defaults there with whatever you want.
  • In the terminal fragments, add all your per-machine profiles. So here you'd add your WSL's, your various different workspaces, etc.

So the one you're putting in the normal settings file is only the things that'll work on every machine.

(Maybe I'm still misunderstanding though ☺️)

@rbanffy
Copy link
Author

rbanffy commented Dec 9, 2021 via email

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants