Profiles Schema: "name" in a profile is required when its not #4144

Closed
opened 2026-01-30 23:39:20 +00:00 by claunia · 5 comments
Owner

Originally created by @skrysm on GitHub (Sep 29, 2019).

Originally assigned to: @leonMSFT on GitHub.

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

  1. Open profiles.json in Visual Studio Code
  2. In one of the profiles remove the name property (i.e. to have it use the name it inherits from the defaults.json).

Expected behavior

I should not get a schema warning.

Actual behavior

I'm getting the following schema warning:

Missing property "name".

Originally created by @skrysm on GitHub (Sep 29, 2019). Originally assigned to: @leonMSFT on GitHub. # Environment ```none 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 1. Open `profiles.json` in Visual Studio Code 1. In one of the profiles remove the `name` property (i.e. to have it use the name it inherits from the `defaults.json`). # Expected behavior I should not get a schema warning. # Actual behavior I'm getting the following schema warning: > Missing property "name".
Author
Owner

@zadjii-msft commented on GitHub (Sep 30, 2019):

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

@zadjii-msft commented on GitHub (Sep 30, 2019): 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
Author
Owner

@skrysm commented on GitHub (Sep 30, 2019):

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.

@skrysm commented on GitHub (Sep 30, 2019): 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.
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 30, 2019):

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...

@DHowett-MSFT commented on GitHub (Sep 30, 2019): 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...
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 30, 2019):

Discussion from triage: except in very narrow circumstances, name is required. The Terminal will want to pop a warning dialog if you omit it.

@DHowett-MSFT commented on GitHub (Sep 30, 2019): Discussion from triage: except in very narrow circumstances, `name` is required. The Terminal will want to pop a warning dialog if you omit it.
Author
Owner

@leonMSFT commented on GitHub (Apr 21, 2020):

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.

@leonMSFT commented on GitHub (Apr 21, 2020): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#4144