When the source property of a profile is set to "Windows.Terminal.PowerShellCore", the name and startingDirectory properties are ignored. #12692

Closed
opened 2026-01-31 03:22:20 +00:00 by claunia · 4 comments
Owner

Originally created by @dead-claudia on GitHub (Feb 23, 2021).

Environment

Windows build number:  10.0.19042.0
Windows Terminal version (if applicable): 1.5.10411.0

Any other software? Not needed for this repro.

Steps to reproduce

  1. Paste the following into the settings file:

    {
        "$schema": "https://aka.ms/terminal-profiles-schema",
        "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "profiles": {
            "list": [
                {
                    "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                    "name": "Test",
                    "source": "Windows.Terminal.PowershellCore",
                    "startingDirectory": "%UserProfile%\\Documents"
                }
            ]
        }
    }
    
  2. Open the Terminal app.

Expected behavior

I start out in the %UserProfile%\Documents folder with the tab title set to "Test".

Actual behavior

I start out in the %UserProfile% folder with the tab title set to "Windows PowerShell".

Other notes

If I use any of these configs instead, the error does not reproduce.

Note: the GUIDs must match. That's a requirement for this to work.

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "profiles": {
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "source": "Windows.Terminal.PowershellCore",
                "startingDirectory": "%UserProfile%\\Documents"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "startingDirectory": "%UserProfile%\\Documents"
            }
        ]
    }
}
{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "profiles": {
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "startingDirectory": "%UserProfile%\\Documents"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "source": "Windows.Terminal.PowershellCore",
                "startingDirectory": "%UserProfile%\\Documents"
            }
        ]
    }
}
{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "profiles": {
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "startingDirectory": "%UserProfile%\\Documents"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "source": "Windows.Terminal.PowershellCore"
            }
        ]
    }
}
{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "profiles": {
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "startingDirectory": "%UserProfile%\\Documents"
            }
        ]
    }
}

The pattern I've detected is that the source must be separate from the name and starting directory for those two to work. Of these two configs, the first shows the right name, but loads the wrong directory, and the second loads the right directory but shows the wrong name.

{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "profiles": {
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "startingDirectory": "%UserProfile%\\Documents"
            }
        ]
    }
}
{
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
    "profiles": {
        "list": [
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "startingDirectory": "%UserProfile%\\Documents",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Test"
            }
        ]
    }
}
Originally created by @dead-claudia on GitHub (Feb 23, 2021). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 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! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.19042.0 Windows Terminal version (if applicable): 1.5.10411.0 Any other software? Not needed for this repro. ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> 1. Paste the following into the settings file: ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "source": "Windows.Terminal.PowershellCore", "startingDirectory": "%UserProfile%\\Documents" } ] } } ``` 2. Open the Terminal app. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> I start out in the `%UserProfile%\Documents` folder with the tab title set to "Test". # Actual behavior <!-- What's actually happening? --> I start out in the `%UserProfile%` folder with the tab title set to "Windows PowerShell". # Other notes If I use any of these configs instead, the error does not reproduce. > Note: the GUIDs *must* match. That's a requirement for this to work. ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "source": "Windows.Terminal.PowershellCore", "startingDirectory": "%UserProfile%\\Documents" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "startingDirectory": "%UserProfile%\\Documents" } ] } } ``` ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "startingDirectory": "%UserProfile%\\Documents" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "source": "Windows.Terminal.PowershellCore", "startingDirectory": "%UserProfile%\\Documents" } ] } } ``` ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "startingDirectory": "%UserProfile%\\Documents" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "source": "Windows.Terminal.PowershellCore" } ] } } ``` ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "source": "Windows.Terminal.PowershellCore" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "startingDirectory": "%UserProfile%\\Documents" } ] } } ``` The pattern I've detected is that the source must be separate from the name and starting directory for those two to work. Of these two configs, the first shows the right name, but loads the wrong directory, and the second loads the right directory but shows the wrong name. ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test", "source": "Windows.Terminal.PowershellCore" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "startingDirectory": "%UserProfile%\\Documents" } ] } } ``` ```json { "$schema": "https://aka.ms/terminal-profiles-schema", "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "profiles": { "list": [ { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "startingDirectory": "%UserProfile%\\Documents", "source": "Windows.Terminal.PowershellCore" }, { "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Test" } ] } } ```
claunia added the Needs-TriageNeeds-Tag-Fix labels 2026-01-31 03:22:20 +00:00
Author
Owner

@dead-claudia commented on GitHub (Feb 23, 2021):

Possibly related: https://github.com/microsoft/terminal/issues/7197

@dead-claudia commented on GitHub (Feb 23, 2021): Possibly related: https://github.com/microsoft/terminal/issues/7197
Author
Owner

@DHowett commented on GitHub (Feb 23, 2021):

The “Windows PowerShell” profile was not originally generated by the “Windows.Terminal.PowershellCore” generator (source), so when we load the settings block with the source it is ignored.

Source has a dual meaning. The first and primary meaning is, “this profile came from a generator”. If we cannot find evidence when we ask the generator that it did, in fact, make that profile... it gets ignored. This is how we make sure that when you uninstall a PS Core or WSL instance we delete the profile too. The second meaning is as a composite primary key with the guid to connect it to your settings.

Remove source from this profile and don’t re-add it. 😄

@DHowett commented on GitHub (Feb 23, 2021): The “Windows PowerShell” profile was not originally generated by the “Windows.Terminal.PowershellCore” generator (source), so when we load the settings block with the `source` it is ignored. Source has a dual meaning. The first and primary meaning is, “this profile _came from a generator_”. If we cannot find evidence when we ask the generator that it did, in fact, make that profile... it gets ignored. This is how we make sure that when you uninstall a PS Core or WSL instance _we delete the profile too_. The second meaning is as a composite primary key with the guid to connect it to your settings. Remove source from this profile and don’t re-add it. :smile:
Author
Owner

@dead-claudia commented on GitHub (Mar 1, 2021):

@DHowett So what's your recommendation for resolving this on my end beyond removing the source, to ensure it's a PowerShell shell?

@dead-claudia commented on GitHub (Mar 1, 2021): @DHowett So what's your recommendation for resolving this on my end beyond removing the source, to ensure it's a PowerShell shell?
Author
Owner

@DHowett commented on GitHub (Mar 1, 2021):

@isiahmeadows it’ll automatically be a PowerShell shell so long as the commandline points to a powershell executable. Ah, i see. I missed that at first! You can set the commandline to point to any version of PowerShell on your computer. The “source” version is only for one autodetected profile per version of powershell(!), which is something we’re working on letting you configure.

@DHowett commented on GitHub (Mar 1, 2021): @isiahmeadows it’ll automatically be a PowerShell shell so long as the commandline points to a powershell executable. Ah, i see. I missed that at first! You can set the commandline to point to any version of PowerShell on your computer. The “source” version is only for _one autodetected profile per version of powershell(!)_, which is something we’re working on letting you configure.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12692