Add default profile to user json if it is not specified #8619

Closed
opened 2026-01-31 01:33:57 +00:00 by claunia · 4 comments
Owner

Originally created by @Karl-WE on GitHub (May 27, 2020).

Description of the new feature/enhancement

Current version generates two settings json files. A baseline that may not be edited (ctrl+settings) and a user locale one that is generated too, but which can be edited by a user.

Both will have auto generated profiles for recognized products ex. PoSh 7, cmd etc.

That's great.

For all users that might not want to dig deep into all possible settings that a json can possibly hold it's not easy to understand without reading docs and knowing of the existence of the global settings json how to alter a default console / profile

Again changing the default json isn't possible.

Adding a default profile (console)
manually can be quite some work.

It is more prone to user errors when setting this up or copy and adding from the default json. Especially json formatting issues without using a proper editor like VSC. Not all might want to install VSC or other code aware editors as notepad++ but by default we have Microsoft Notepad (app).

Currently the local user json is missing this the line for the default profile.

Mind Terminal users aren't necessarily Devs. #NotADev

Proposed technical implementation details (optional)

Please while generating the user local json, parse if it does contain a line for a default profile

Add default profile otherwise as in global settings json.

If it does exist don't touch.

This would ease the usage for new users.

Originally created by @Karl-WE on GitHub (May 27, 2020). # Description of the new feature/enhancement Current version generates two settings json files. A baseline that may not be edited (ctrl+settings) and a user locale one that is generated too, but which can be edited by a user. Both will have auto generated profiles for recognized products ex. PoSh 7, cmd etc. That's great. For all users that might not want to dig deep into all possible settings that a json can possibly hold it's not easy to understand without reading docs and knowing of the existence of the global settings json how to alter a default console / profile Again changing the default json isn't possible. Adding a default profile (console) manually can be quite some work. It is more prone to user errors when setting this up or copy and adding from the default json. Especially json formatting issues without using a proper editor like VSC. Not all might want to install VSC or other code aware editors as notepad++ but by default we have Microsoft Notepad (app). Currently the local user json is missing this the line for the default profile. Mind Terminal users aren't necessarily Devs. #NotADev # Proposed technical implementation details (optional) Please while generating the user local json, parse if it does contain a line for a default profile Add default profile otherwise as in global settings json. If it does exist don't touch. This would ease the usage for new users.
Author
Owner

@zadjii-msft commented on GitHub (May 27, 2020):

I'm 100% positive that defaultProfile is already a part of the json file we generate on first launch:

https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/userDefaults.json#L11

We'll take that %DEFAULT_PROFILE% and replace it with the guid of Powershell Core or legacy powershell, but that line is definitely always present.

@zadjii-msft commented on GitHub (May 27, 2020): I'm 100% positive that `defaultProfile` is already a part of the json file we generate on first launch: https://github.com/microsoft/terminal/blob/master/src/cascadia/TerminalApp/userDefaults.json#L11 We'll take that `%DEFAULT_PROFILE%` and replace it with the guid of Powershell Core or legacy powershell, but that line is definitely always present.
Author
Owner

@Karl-WE commented on GitHub (May 27, 2020):

Thanks for checking, I will recheck this in a VM and report back. Errare humanum est. Yet I had to add it in my config file. (Did upgrade to the current from a pre-release version via Microsoft Store).

@Karl-WE commented on GitHub (May 27, 2020): Thanks for checking, I will recheck this in a VM and report back. Errare humanum est. Yet I had to add it in my config file. (Did upgrade to the current from a pre-release version via Microsoft Store).
Author
Owner

@Karl-WE commented on GitHub (May 27, 2020):

Hi @zadjii-msft I cannot explain but I had to add this line manually to override the json global default which would choose cmd
the UUID below is a PosH7 release that got added automatically.

"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",

Given what Dustin said my json is old see the other feature request I've made a mention. Perhaps this might be a doable / good solution.

I will close this for now, as I don't think I can repro this. My oldest backup does not contain the file before I added the lines.

@Karl-WE commented on GitHub (May 27, 2020): Hi @zadjii-msft I cannot explain but I had to add this line manually to override the json global default which would choose cmd the UUID below is a PosH7 release that got added automatically. "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", Given what Dustin said my json is old see the other feature request I've made a mention. Perhaps this might be a doable / good solution. I will close this for now, as I don't think I can repro this. My oldest backup does not contain the file before I added the lines.
Author
Owner

@Karl-WE commented on GitHub (May 27, 2020):

see above, cannot exactly repro, due to an old json from a pre-release. Thanks for you time looking into this request.

my json was so old that it did not have any disclaimer like this. I deleted my jsons and let terminal generate new ones. There default profile is included.

// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

@Karl-WE commented on GitHub (May 27, 2020): see above, cannot exactly repro, due to an old json from a pre-release. Thanks for you time looking into this request. my json was so old that it did not have any disclaimer like this. I deleted my jsons and let terminal generate new ones. There default profile is included. // This file was initially generated by Windows Terminal 1.0.1401.0 // It should still be usable in newer versions, but newer versions might have additional // settings, help text, or changes that you will not see unless you clear this file // and let us generate a new one for you.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8619