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

Feature Request - use a directory for profiles #2303

Closed
dbacher opened this issue Aug 6, 2019 · 12 comments
Closed

Feature Request - use a directory for profiles #2303

dbacher opened this issue Aug 6, 2019 · 12 comments
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.

Comments

@dbacher
Copy link

dbacher commented Aug 6, 2019

Use C:\ProgramData\Microsoft\Terminal, or similar, make a directory named "Profiles."
Use %APPDATA%\Microsoft\Terminal, or similar, make a directory there named "Profiles."

On startup, while reading the settings - enumerate each file in those two directories (maybe with a JSON file extension), parse it, and if it parses - add it to the profiles.

That would allow an installer from another team, for example from Visual Studio, Azure, etc. to hang a profile just by copying in a file like visual-studio-2019-cmd-tools.json or windows-platform-sdk.json.

Using separate files makes uninstall better, but this would basically be very similar to /etc/shells on Linux.

@dbacher dbacher added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 6, 2019
@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 6, 2019
@carlos-zamora carlos-zamora added Area-Settings Issues related to settings and customizability, for console or terminal Product-Terminal The new Windows Terminal. and removed Needs-Tag-Fix Doesn't match tag requirements labels Aug 7, 2019
@DHowett-MSFT
Copy link
Contributor

The more I think about this, the more I like the idea of dovetailing it with the dynamic profile specification from #754 😄

@dbacher
Copy link
Author

dbacher commented Aug 8, 2019

The reason that I suggested this is there is an easy rule for many developers. The easier something is to do, the more likely they do it. Every installer can copy a file, every uninstaller can delete a file. However, modifying a JSON file? Not so much.
If I'm JASC and I'm writing 4NT (yeah, I know old school), if my installer just has to copy a file - I'm likely to do that. IF you use this approach, you might want a version tag as well.

@ffes
Copy link

ffes commented Aug 8, 2019

And let the user define extra locations (yes, plural) , like \\server\share\path or %USERPROFILE%\OneDrive\SomePath where profiles are being searched for as well

@zadjii-msft
Copy link
Member

I'm pretty specifically leaving out having more locations for settings files from the #1258 spec. It's definitely something I've been thinking about, but I'm afraid that adding that section would delay delivering the basic User+Default settings by a few months.

This is definitely a good idea, but lets please not rope it in with #754 :)

@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Aug 8, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Aug 8, 2019
@DHowett-MSFT
Copy link
Contributor

Just following up: we chatted o*line -- the intent was not to combine it with #754, just to say that #754 will make this infinitely easier.

@jantari
Copy link
Contributor

jantari commented Aug 18, 2019

This could be done in the Linux-way too:

Master/default settings file is:

%path%/profiles.json

But every json file inside this directory is also parsed in alphabetical order and may overwrite the settings set in the master file:

%path%/profiles.d/10-anything.json
%path%/profiles.d/20-anything.json
%path%/profiles.d/99-anything.json

This approach is familiar to most people who have used a linux-based OS before as many standard utils handle their configuration in this manner and it would work on Windows just the same.

@zadjii-msft
Copy link
Member

For linking purposes, this seems related to #1690

@deoradh
Copy link

deoradh commented Feb 20, 2020

I really want the ability to easily backup my settings (eg, to OneDrive), and this provides a way to do so.

One suggestion:

  • Include the ability to override the settings location via the command line (and being able to use this as a shortcut). That would be useful for defining sets of profiles and store them in source control or on a network share. I'm sure we've all used special command line shortcuts in the past...

@zadjii-msft
Copy link
Member

Hey wait, isn't this exactly what we did with #1690, #7584, #7632, https://docs.microsoft.com/en-us/windows/terminal/json-fragment-extensions?

We could keep using #2933 for "let the user specify another path to load settings from". But I think the fundamental premise of

That would allow an installer from another team, for example from Visual Studio, Azure, etc. to hang a profile just by copying in a file like visual-studio-2019-cmd-tools.json or windows-platform-sdk.json.

is covered now, yea?

@zadjii-msft
Copy link
Member

(I'm gonna answer my own question: yes, it is covered now)

@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label Dec 8, 2021
@dbacher
Copy link
Author

dbacher commented Dec 8, 2021

Sorry, had meant to confirm this a long time ago and got distracted by other things. Indeed, this is addressed by the changes you've made to the terminal client.

@zadjii-msft
Copy link
Member

No worries, I'm persistently distracted by other things 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings Issues related to settings and customizability, for console or terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

7 participants