Retain existing comments in JSON #14805

Open
opened 2026-01-31 04:19:58 +00:00 by claunia · 0 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:19:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14805