Add support for inheriting and overriding another profile's settings #5361

Open
opened 2026-01-31 00:11:26 +00:00 by claunia · 12 comments
Owner

Originally created by @krisavi on GitHub (Dec 3, 2019).

Description of the new feature/enhancement

I would like to make 2 profiles for same WSL, But as I tested, then you cannot put different GUID to make a duplicate with changes. I guess it is something to do with having same GUID and generator approach for the WSL using source field does not let you to have multiple GUIDs for same profile.

Proposed technical implementation details (optional)

One way would be to let you have different name field for the same GUID and treat them different not merging settings.
Other one I see is to have generator make a guid GUID to a group of terminals with same source, but then have subitem that could have multiple choices.
Then to have a submenu for each terminal profile based on it that basically could have custom generated GUID. If there is only one subprofiles item, then it shows only one and not as a submenu.
Profiles.json then could be something like:

    {
      "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}",
      "hidden": false,
      "source": "Windows.Terminal.Wsl",
      "subProfiles": [
        {
          "guid": "{58ad8b0c-bc6f-3ef8-5f4d-13e4c00f2531}",
          "name": "Debian Half Dark",
          "useAcrylic": true,
          "fontFace": "Fira Code",
          "acrylicOpacity": 0.2,
          "colorScheme": "One Half Dark",
          "padding": "0, 0, 0, 0",
        },
        {
          "guid": "{58ad8b0c-5f4d-bc6f-3ef8-13e4c00f2532}",
          "name": "Debian Light",
          "useAcrylic": true,
          "fontFace": "Cascadia Code",
          "acrylicOpacity": 0.2,
          "colorScheme": "One Half Light",
          "padding": "0, 0, 0, 0",
        }
      ]
    }
Originally created by @krisavi on GitHub (Dec 3, 2019). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> # Description of the new feature/enhancement I would like to make 2 profiles for same WSL, But as I tested, then you cannot put different GUID to make a duplicate with changes. I guess it is something to do with having same GUID and generator approach for the WSL using source field does not let you to have multiple GUIDs for same profile. <!-- A clear and concise description of what the problem is that the new feature would solve. Describe why and how a user would use this new functionality (if applicable). --> # Proposed technical implementation details (optional) One way would be to let you have different name field for the same GUID and treat them different not merging settings. Other one I see is to have generator make a guid GUID to a group of terminals with same source, but then have subitem that could have multiple choices. Then to have a submenu for each terminal profile based on it that basically could have custom generated GUID. If there is only one subprofiles item, then it shows only one and not as a submenu. Profiles.json then could be something like: ``` { "guid": "{58ad8b0c-3ef8-5f4d-bc6f-13e4c00f2530}", "hidden": false, "source": "Windows.Terminal.Wsl", "subProfiles": [ { "guid": "{58ad8b0c-bc6f-3ef8-5f4d-13e4c00f2531}", "name": "Debian Half Dark", "useAcrylic": true, "fontFace": "Fira Code", "acrylicOpacity": 0.2, "colorScheme": "One Half Dark", "padding": "0, 0, 0, 0", }, { "guid": "{58ad8b0c-5f4d-bc6f-3ef8-13e4c00f2532}", "name": "Debian Light", "useAcrylic": true, "fontFace": "Cascadia Code", "acrylicOpacity": 0.2, "colorScheme": "One Half Light", "padding": "0, 0, 0, 0", } ] } ``` <!-- A clear and concise description of what you want to happen. -->
claunia added the Issue-FeatureArea-SettingsProduct-Terminal labels 2026-01-31 00:11:27 +00:00
Author
Owner

@DHowett-MSFT commented on GitHub (Dec 5, 2019):

Congrats - this is now the bug for adding support for inheriting and overriding another profile's settings. It's something we've talked about for the post-v1.0 timeframe.

@DHowett-MSFT commented on GitHub (Dec 5, 2019): Congrats - this is now the bug for adding support for inheriting and overriding another profile's settings. It's something we've talked about for the post-v1.0 timeframe.
Author
Owner

@raworre commented on GitHub (Jan 29, 2020):

I'm looking around the issues here to see if there was anything documented about the feature I'm looking for. Wondering if my use case fits under "inheriting" as it's defined in this issue.

My use case is such that I would like to have the same background and font settings for all of my profiles. Currently I have to enter those fields in each profile like thus:

{
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "name": "Windows PowerShell",
    "commandline": "powershell.exe",
    "hidden": false,
    "fontFace": "Consolas",
    "fontSize": 10,
    "background": "#272935",
    "backgroundImage": "%SOURCE_ROOT%/images/mushroom_cloud.jpg",
    "backgroundImageOpacity": 0.1,
    "startingDirectory": "%SOURCE_ROOT%",
    "tabTitle": "PowerShell 5.1"
},
{
    "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
    "name": "cmd",
    "commandline": "cmd.exe",
    "hidden": false,
    "fontFace": "Consolas",
    "fontSize": 10,
    "background": "#272935",
    "backgroundImage": "%SOURCE_ROOT%/images/mushroom_cloud.jpg",
    "backgroundImageOpacity": 0.1,
    "startingDirectory": "%SOURCE_ROOT%",
    "tabTitle": "Windows Command Prompt"
}

I would like to be able to set a shared profile that looked something like below that could then be referenced as a parent in other profiles.

{
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bx}",
    "name": "Default Profile",
    "fontFace": "Consolas",
    "fontSize": 10,
    "background": "#272935",
    "backgroundImage": "$SOURCE_ROOT%/images/mushroom_cloud.jpg",
    "backgroundImageOpacity": 0.1,
    "startingDirectory": "%SOURCE_ROOT%"
},
{
    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "name": "Windows PowerShell",
    "commandline": "powershell.exe",
    "hidden": false,
    "parentProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bx}",
    "tabTitle": "PowerShell 5.1"
},
{
    "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
    "name": "cmd",
    "commandline": "cmd.exe",
    "hidden": false,
    "parentProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bx}",
    "tabTitle": "Windows Command Prompt"
}

Just wanting to make sure this is the issue I want to watch for this behavior, if there is another issue encompassing this behavior, or if it already exists and I've completely missed it.

@raworre commented on GitHub (Jan 29, 2020): I'm looking around the issues here to see if there was anything documented about the feature I'm looking for. Wondering if my use case fits under "inheriting" as it's defined in this issue. My use case is such that I would like to have the same background and font settings for all of my profiles. Currently I have to enter those fields in each profile like thus: ```json { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false, "fontFace": "Consolas", "fontSize": 10, "background": "#272935", "backgroundImage": "%SOURCE_ROOT%/images/mushroom_cloud.jpg", "backgroundImageOpacity": 0.1, "startingDirectory": "%SOURCE_ROOT%", "tabTitle": "PowerShell 5.1" }, { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "cmd", "commandline": "cmd.exe", "hidden": false, "fontFace": "Consolas", "fontSize": 10, "background": "#272935", "backgroundImage": "%SOURCE_ROOT%/images/mushroom_cloud.jpg", "backgroundImageOpacity": 0.1, "startingDirectory": "%SOURCE_ROOT%", "tabTitle": "Windows Command Prompt" } ``` I would like to be able to set a shared profile that looked something like below that could then be referenced as a parent in other profiles. ```json { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bx}", "name": "Default Profile", "fontFace": "Consolas", "fontSize": 10, "background": "#272935", "backgroundImage": "$SOURCE_ROOT%/images/mushroom_cloud.jpg", "backgroundImageOpacity": 0.1, "startingDirectory": "%SOURCE_ROOT%" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell", "commandline": "powershell.exe", "hidden": false, "parentProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bx}", "tabTitle": "PowerShell 5.1" }, { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "cmd", "commandline": "cmd.exe", "hidden": false, "parentProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bx}", "tabTitle": "Windows Command Prompt" } ``` Just wanting to make sure this is the issue I want to watch for this behavior, if there is another issue encompassing this behavior, or if it already exists and I've completely missed it.
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 29, 2020):

@raworre I’ve got great news for you! We shipped defaults in 0.8; check out the docs!

@DHowett-MSFT commented on GitHub (Jan 29, 2020): @raworre I’ve got great news for you! We shipped defaults in 0.8; check out [the docs](https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md#default-settings)!
Author
Owner

@raworre commented on GitHub (Jan 29, 2020):

@DHowett-MSFT Giggity! Thanks for the quick reply! Absolutely loving the product so far.

@raworre commented on GitHub (Jan 29, 2020): @DHowett-MSFT Giggity! Thanks for the quick reply! Absolutely loving the product so far.
Author
Owner

@UsmanMohammad commented on GitHub (Feb 4, 2020):

The one issue it doesn't solve is inheriting the icon, as I do have to manually set the icon for every Powershell Core terminal

@UsmanMohammad commented on GitHub (Feb 4, 2020): The one issue it doesn't solve is inheriting the icon, as I do have to manually set the icon for every Powershell Core terminal
Author
Owner

@mikemklee commented on GitHub (Apr 9, 2020):

Is there still no way to have multiple WSL profiles?

@mikemklee commented on GitHub (Apr 9, 2020): Is there still no way to have multiple WSL profiles?
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 9, 2020):

{
"name": "my other ubuntu profile",
"commandline": "wsl -d Ubuntu",
"colorScheme": "Presumably the reason I added a second copy of ubuntu colors"
}
@DHowett-MSFT commented on GitHub (Apr 9, 2020): ```json { "name": "my other ubuntu profile", "commandline": "wsl -d Ubuntu", "colorScheme": "Presumably the reason I added a second copy of ubuntu colors" } ```
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 9, 2020):

{
"name": "my other ubuntu profile",
"commandline": "wsl -d Ubuntu",
"colorScheme": "Presumably the reason I added a second copy of ubuntu colors",
"icon": "c:/path/to/literally/any/icon"
}

We've actually got a document explaining the cool settings you can use, if you're interested 😄. The docs entry point is a good place to start, but it does bury the lede a bit.

@DHowett-MSFT commented on GitHub (Apr 9, 2020): ```json { "name": "my other ubuntu profile", "commandline": "wsl -d Ubuntu", "colorScheme": "Presumably the reason I added a second copy of ubuntu colors", "icon": "c:/path/to/literally/any/icon" } ``` We've actually got a [document explaining the cool settings you can use](https://github.com/microsoft/terminal/blob/master/doc/cascadia/SettingsSchema.md), if you're interested :smile:. The [docs entry point](https://github.com/microsoft/terminal/blob/master/doc/user-docs/UsingJsonSettings.md) is a good place to start, but it does bury the lede a bit.
Author
Owner

@mikemklee commented on GitHub (Apr 9, 2020):

@DHowett-MSFT Ah! What got me confused was the correct syntax for the path.

I knew that there is the //wsl$/Ubuntu/... for specifying wsl paths,
and that there is /mnt/c/... for spcifying window paths.

I did not know about the c:/... syntax.

I tried this: "icon": "/mnt/c/path/to/icon" but got confused because I kept getting an invalid icon path error.

Your solution worked like a charm! thank you!

Edit:
I get it now. Because Windows Terminal is running on the windows side, I need to specify my path in the windows syntax, not the WSL syntax... aha!

@mikemklee commented on GitHub (Apr 9, 2020): @DHowett-MSFT Ah! What got me confused was the correct syntax for the path. I knew that there is the `//wsl$/Ubuntu/...` for specifying wsl paths, and that there is `/mnt/c/...` for spcifying window paths. I did not know about the `c:/...` syntax. I tried this: `"icon": "/mnt/c/path/to/icon"` but got confused because I kept getting an `invalid icon path` error. Your solution worked like a charm! thank you! Edit: I get it now. Because Windows Terminal is running on the windows side, I need to specify my path in the windows syntax, not the WSL syntax... aha!
Author
Owner

@saadanerdetbare commented on GitHub (May 2, 2020):

As a comment to the idea OP posted, if this could be done with PS Core and adding support for having alternate $profile settings in the different profiles this would be cool

@saadanerdetbare commented on GitHub (May 2, 2020): As a comment to the idea OP posted, if this could be done with PS Core and adding support for having alternate $profile settings in the different profiles this would be cool
Author
Owner

@DHowett-MSFT commented on GitHub (May 2, 2020):

As a comment to the idea OP posted, if this could be done with PS Core and adding support for having alternate $profile settings in the different profiles this would be cool

So for this one, at least, you can use $Env:WT_PROFILE_ID (which will always match your profile GUID) to set different settings in profile.ps1 for different WT profiles.

@DHowett-MSFT commented on GitHub (May 2, 2020): > > > As a comment to the idea OP posted, if this could be done with PS Core and adding support for having alternate $profile settings in the different profiles this would be cool So for this one, at least, you can use `$Env:WT_PROFILE_ID` (which will always match your profile GUID) to set different settings in profile.ps1 for different WT profiles.
Author
Owner

@saadanerdetbare commented on GitHub (May 3, 2020):

So for this one, at least, you can use $Env:WT_PROFILE_ID (which will always match your profile GUID) to set different settings in profile.ps1 for different WT profiles.

Ok, didn't know there was a variable for the guid. So as per #4160 and #5490 just make a profile with commandline pwsh.exe and simply invoke $Env:WT_PROFILE_ID.ps1 from $profile

@saadanerdetbare commented on GitHub (May 3, 2020): > So for this one, at least, you can use `$Env:WT_PROFILE_ID` (which will always match your profile GUID) to set different settings in profile.ps1 for different WT profiles. Ok, didn't know there was a variable for the guid. So as per #4160 and #5490 just make a profile with commandline pwsh.exe and simply invoke `$Env:WT_PROFILE_ID.ps1` from $profile
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5361