Retain existing comments in JSON #14807

Closed
opened 2026-01-31 04:20:00 +00:00 by claunia · 3 comments
Owner

Originally created by @mrjoel on GitHub (Aug 6, 2021).

Windows Terminal version (or Windows build number)

1.9.1942.0

Other Software

No response

Steps to reproduce

  • Run Windows Terminal using an existing settings.json with // line comments
  • Open Settings UI and save (without changing anything)
  • Note that the settings.json line comments are removed

Expected Behavior

I expect that existing comments are retained. The parsing clearly supports them, and defaults.json includes several comments as well. As noted in #9861, comments are (were?) intentionally retained at least in the actions array as part of migration. I'd expect them to be retained always.

If the plan is to deprecate comments, then a preferable alternative would be to support a settings.yaml in order to retain comments in an official syntax manner.

Actual Behavior

All // line comments are stripped when rewriting settings.json

Originally created by @mrjoel on GitHub (Aug 6, 2021). ### Windows Terminal version (or Windows build number) 1.9.1942.0 ### Other Software _No response_ ### Steps to reproduce * Run Windows Terminal using an existing settings.json with `//` line comments * Open Settings UI and save (without changing anything) * Note that the settings.json line comments are removed ### Expected Behavior I expect that existing comments are retained. The parsing clearly supports them, and defaults.json includes several comments as well. As noted in #9861, comments are (were?) intentionally retained at least in the `actions` array as part of migration. I'd expect them to be retained always. If the plan is to deprecate comments, then a preferable alternative would be to support a `settings.yaml` in order to retain comments in an official syntax manner. ### Actual Behavior All `//` line comments are stripped when rewriting settings.json
claunia added the Resolution-Duplicate label 2026-01-31 04:20:00 +00:00
Author
Owner

@j4james commented on GitHub (Aug 6, 2021):

I believe this will be covered by #8991. See also #9167.

@j4james commented on GitHub (Aug 6, 2021): I believe this will be covered by #8991. See also #9167.
Author
Owner

@zadjii-msft commented on GitHub (Aug 9, 2021):

Yea, this is gonna be covered by /dup #8991. Thanks!

@zadjii-msft commented on GitHub (Aug 9, 2021): Yea, this is gonna be covered by /dup #8991. Thanks!
Author
Owner

@ghost commented on GitHub (Aug 9, 2021):

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost commented on GitHub (Aug 9, 2021): Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14807