How does the `guid` in dynamic profiles in Windows Terminal work to find the target?

82 views Asked by At

I've worked with Windows Terminal for a while. Recently, I wanted to add some additional 3rd party command line tools into dynamic profiles in Windows Terminal.

It must be successful if using commandline. But if not used, how does the Windows Terminal find our target items?

Maybe out of curiosity, I cannot understand the automatically created profiles, such as WSL or PowerShell:

{
    "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "hidden": false,
    "name": "PowerShell",
    "source": "Windows.Terminal.PowershellCore"
},
{
    "guid": "{d7b20cea-47a9-518c-95a4-c8bd91e2e1c6}",
    "hidden": false,
    "name": "Ubuntu 22.04.2 LTS",
    "source": "CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc"
},

I've done some ablation experiments and found the following points:

  • If I comment out the name and source of PowerShell, but retain the guid, this profile will still work.
  • If I comment out the guid of PowerShell, but retain the other settings, this profile will not work.
  • If I comment out the name and source of Ubuntu 22.04.2 LTS, but retain the guid, this profile will still work.
  • If I comment out the guid of Ubuntu 22.04.2 LTS, but retain other settings, this profile will still work.

My problems are:

  • How can Windows Terminal find the target by the GUID?
  • Why in the above samples, can Ubuntu 22.04.2 LTS still be found when given only the source and name and without guid?
  • If so, why can't, in the above sample, the PowerShell be found when given only the source and name and without guid?
0

There are 0 answers