Need a way to have per-machine profiles in settings #911

Open
opened 2026-01-30 22:09:53 +00:00 by claunia · 4 comments
Owner

Originally created by @miniksa on GitHub (May 9, 2019).

Settings roam, which is really cool! However, my machines don't all have the same configuration. For instance, my main dev machine has tooling installed on the O: drive. My default profile runs the VS command prompt batch file. Well, I just dropped terminal on a second machine that doesn't have the same hardware config, so this default profile is totally busted there. Thankfully I'm launching with cmd /k o:\...foo.cmd, so I just get a slightly annoying error from CMD.

However, we'll need a way to have some way of differentiating config. As an idea, in other tools (e.g. emacs), it's not uncommon to key off of machine name to vary configuration.

=========

After a brief discussion in triage, we realize that there's going to need to be a thorough design of how we want per-machine settings to be done here.

The initial design of settings is "simple" in that all settings applied in an unfiltered fashion and there's only 1 file and we have no "settings UI yet".

There's advantages to no settings UI.
There's advantages to having only one settings file.
There's advantages to being able to layer multiple settings files.
And so on and so forth.

Therefore, it's a feature that someone needs to sit down and spec at a future date.

Originally created by @miniksa on GitHub (May 9, 2019). Settings roam, which is really cool! However, my machines don't all have the same configuration. For instance, my main dev machine has tooling installed on the `O:` drive. My default profile runs the VS command prompt batch file. Well, I just dropped terminal on a second machine that doesn't have the same hardware config, so this default profile is totally busted there. Thankfully I'm launching with `cmd /k o:\...foo.cmd`, so I just get a slightly annoying error from CMD. However, we'll need a way to have some way of differentiating config. As an idea, in other tools (e.g. emacs), it's not uncommon to key off of machine name to vary configuration. ========= After a brief discussion in triage, we realize that there's going to need to be a thorough design of how we want per-machine settings to be done here. The initial design of settings is "simple" in that all settings applied in an unfiltered fashion and there's only 1 file and we have no "settings UI yet". There's advantages to no settings UI. There's advantages to having only one settings file. There's advantages to being able to layer multiple settings files. And so on and so forth. Therefore, it's a feature that someone needs to sit down and spec at a future date.
claunia added the Issue-FeatureArea-SettingsProduct-Terminal labels 2026-01-30 22:09:53 +00:00
Author
Owner

@paulcam206 commented on GitHub (May 10, 2019):

obviously not in my realm of influence any more, but for your consideration (partial settings chunk):

Simple

   {
      "guid": "{b97b625d-325f-4283-86c0-8d6f071f8767}",
      "name": "SomeProfileThatMaybeOnlyAppliesToOneMachine",
      "when": "specificComputerNameHere",
      "etc": "blahblah"
   }

Bonus points

when supports globs.

I buy you a beer

when supports an arbitrary conditional language that lets users make choices based on relevant parameters like DPI, resolution, light/dark theme, cpu architecture, etc.

@paulcam206 commented on GitHub (May 10, 2019): obviously not in my realm of influence any more, but for your consideration (partial settings chunk): ### Simple ```json { "guid": "{b97b625d-325f-4283-86c0-8d6f071f8767}", "name": "SomeProfileThatMaybeOnlyAppliesToOneMachine", "when": "specificComputerNameHere", "etc": "blahblah" } ``` ### Bonus points `when` supports globs. ### I buy you a beer `when` supports an arbitrary conditional language that lets users make choices based on relevant parameters like DPI, resolution, light/dark theme, cpu architecture, etc.
Author
Owner

@rbanffy commented on GitHub (Dec 8, 2021):

As an idea, in other tools (e.g. emacs), it's not uncommon to key off of machine name to vary configuration.

That's easy to do with Emacs because init.el (or any of its flavors) is a program that sets up Emacs' internal state. It's an incredibly neat approach, but lots of users hate it (and it introduces a possible issue with config files running forever). I used to have an init.el that measured the size of the frame in columns and adjusted font size to always fit at least 80 columns.

Therefore, it's a feature that someone needs to sit down and spec at a future date.

On #11904 I suggested having a separate file for the profiles, which would allow each machine to have its own profiles, while keeping all other settings where they currently are (in my own case, I'd like to link it to a dotfiles repo I use to keep config files - init.el included). On that issue, @zadjii-msft suggested I use the fragments functionality to implement this functionality for me, but I still think splitting settings and profiles would be a good default behavior and something it'd be worth to have a spec for. I'd love to help on writing one and joining the discussion.

@rbanffy commented on GitHub (Dec 8, 2021): > As an idea, in other tools (e.g. emacs), it's not uncommon to key off of machine name to vary configuration. That's easy to do with Emacs because `init.el` (or any of its flavors) is a program that sets up Emacs' internal state. It's an incredibly neat approach, but lots of users hate it (and it introduces a possible issue with config files running forever). I used to have an `init.el` that measured the size of the frame in columns and adjusted font size to always fit at least 80 columns. > Therefore, it's a feature that someone needs to sit down and spec at a future date. On #11904 I suggested having a separate file for the profiles, which would allow each machine to have its own profiles, while keeping all other settings where they currently are (in my own case, I'd like to link it to a dotfiles repo I use to keep config files - init.el included). On that issue, @zadjii-msft suggested I use the fragments functionality to implement this functionality for me, but I still think splitting settings and profiles would be a good default behavior and something it'd be worth to have a spec for. I'd love to help on writing one and joining the discussion.
Author
Owner

@miniksa commented on GitHub (Dec 9, 2021):

@carlos-zamora, @zadjii-msft ... I believe both of you have a lot more conceptual knowledge on settings than I do. If @rbanffy wants to help figure this out, can you provide guidance?

@miniksa commented on GitHub (Dec 9, 2021): @carlos-zamora, @zadjii-msft ... I believe both of you have a lot more conceptual knowledge on settings than I do. If @rbanffy wants to help figure this out, can you provide guidance?
Author
Owner

@carlos-zamora commented on GitHub (Dec 9, 2021):

On #11904 I suggested having a separate file for the profiles, which would allow each machine to have its own profiles, while keeping all other settings where they currently are (in my own case, I'd like to link it to a dotfiles repo I use to keep config files - init.el included). On that issue, @zadjii-msft suggested I use the fragments functionality to implement this functionality for me, but I still think splitting settings and profiles would be a good default behavior and something it'd be worth to have a spec for. I'd love to help on writing one and joining the discussion.

Sorry, I'm still confused on what you're proposing and how that differs from fragments. Fragments are already a separate file for profiles/schemes.

I'm also confused about the use case you're talking about. In #11904, it seems like you want a profiles.defaults that differs by machine?

@carlos-zamora commented on GitHub (Dec 9, 2021): > On #11904 I suggested having a separate file for the profiles, which would allow each machine to have its own profiles, while keeping all other settings where they currently are (in my own case, I'd like to link it to a dotfiles repo I use to keep config files - init.el included). On that issue, @zadjii-msft suggested I use the fragments functionality to implement this functionality for me, but I still think splitting settings and profiles would be a good default behavior and something it'd be worth to have a spec for. I'd love to help on writing one and joining the discussion. Sorry, I'm still confused on what you're proposing and how that differs from fragments. Fragments are already a separate file for profiles/schemes. I'm also confused about the use case you're talking about. In #11904, it seems like you want a `profiles.defaults` that differs by machine?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#911