Profiles Schema: "name" in a profile is required when its not
Environment
Windows build number: Microsoft Windows [Version 10.0.18362.356]
Windows Terminal version (if applicable): 0.5.2681.0
Any other software?
Visual Studio Code: 1.38.1
Steps to reproduce
- Open
profiles.jsonin Visual Studio Code - In one of the profiles remove the
nameproperty (i.e. to have it use the name it inherits from thedefaults.json).
Expected behavior
I should not get a schema warning.
Actual behavior
I'm getting the following schema warning:
Missing property "name".
This one's tricky. The defaults don't need a name, that's correct, because they already have a name set in the defaults.json. However, every other profile will still require a name.
I'm leaning towards leaving it marked required, but I'm open to ideas.
cc @cinnamon-msft @DHowett-MSFT @bitcrazed
I see. I mean you could make the name actually optional. If none is provided, fall back to the command line for the profile's name (e.g. powershell.exe) and if this property is missing too, use the profile's guid.
Unfortunately, GUID is also optional (now) and commandline isn’t required for all types of connections. Still, worth investigating a third form of primary key material...
Discussion from triage: except in very narrow circumstances, name is required. The Terminal will want to pop a warning dialog if you omit it.
So unfortunately, the schema isn't flexible enough to capture how Terminal parses its settings, specifically how the name property might be provided from another source (like defaults.json) when you haven't specified one in your settings file. In the future post v1 when we land a settings UI, this should be less of an issue because we'll have more nuanced control of how a user's settings are composed! For now though, we'd like to keep the current behavior where it'll give you a schema warning because we believe that name is recommended even if it isn't technically required and won't break if you don't have one.