Use JSONC / allow comments in JSON per other Microsoft products #3205

Closed
opened 2026-01-30 23:15:45 +00:00 by claunia · 4 comments
Owner

Originally created by @mikemaccana on GitHub (Aug 6, 2019).

Windows 10.0.18362.0, Terminal Preview 3.

I needed to add a comment explaining why I'd disabled a config option

image

This is correct, comments aren't permitted in JSON. Terminal, like vsCode, should use JSONC (whether it has a .json or .jsonc extension):

image

I know Code and Terminal are different teams but consistency would be good here, and comments are useful.

Originally created by @mikemaccana on GitHub (Aug 6, 2019). Windows 10.0.18362.0, Terminal Preview 3. I needed to add a comment explaining why I'd disabled a config option ![image](https://user-images.githubusercontent.com/172594/62541842-846bd800-b852-11e9-9c85-420e85bdcfaf.png) This is correct, comments aren't permitted in JSON. Terminal, like vsCode, should use JSONC (whether it has a .json or .jsonc extension): ![image](https://user-images.githubusercontent.com/172594/62541915-a49b9700-b852-11e9-9450-e11d359a80e2.png) I know Code and Terminal are different teams but consistency would be good here, and comments are useful.
claunia added the Issue-FeatureNeeds-TriageNeeds-Tag-FixResolution-Answered labels 2026-01-30 23:15:45 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Aug 6, 2019):

We actually do allow comments in the json file as of #1005. Dunno why VS Code is tagging the file like that, but they're definitely allowed.

@zadjii-msft commented on GitHub (Aug 6, 2019): We actually do allow comments in the json file as of #1005. Dunno why VS Code is tagging the file like that, but they're definitely allowed.
Author
Owner

@mikemaccana commented on GitHub (Aug 6, 2019):

OK I'll file it with vscode. 👍🏼

@mikemaccana commented on GitHub (Aug 6, 2019): OK I'll file it with vscode. 👍🏼
Author
Owner

@flying-sheep commented on GitHub (Jan 16, 2020):

It highlights it like this because things with a .json extension are supposed to be JSON and not JSONC. Adding an exception in VS Code will only fix it there, not for any other editor. The file should be renamed to reflect its real type.

@flying-sheep commented on GitHub (Jan 16, 2020): It highlights it like this because things with a `.json` extension are supposed to be JSON and not JSONC. Adding an exception in VS Code will only fix it there, not for any other editor. The file should be renamed to reflect its real type.
Author
Owner

@wetterkrank commented on GitHub (Jul 28, 2020):

@zadjii-msft The settings.json file of Windows Terminal is not a valid JSON, so it will alert linters in most code editors. Why don't you rename the file to settings.jsonc?

@wetterkrank commented on GitHub (Jul 28, 2020): @zadjii-msft The settings.json file of Windows Terminal is not a valid JSON, so it will alert linters in most code editors. Why don't you rename the file to settings.jsonc?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3205