microsoft / microsoft/terminal

JSON fails to parse with a trailing comment at the end of an array

Open
#11,545 7 comments 0 reactions 0 assignees View on GitHub
Area-Settings Help Wanted Issue-Bug Product-Terminal Resolution-External
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version (or Windows build number)

1.10.2714.0

### Other Software

_No response_

### Steps to reproduce

In the settings file, put a comment at the end of an object with a comma after it.

This fails:

"actions": [
{},
// ...
],

Dropping either the `,` or the comment makes it work.

### Expected Behavior

Should be parsed as usual since both terminating commas and comments are allowed, or forbid trailing commas (assuming that comments are a desired feature).

### Actual Behavior

> Settings could not be loaded from file. Check for syntax errors, including trailing commas.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure in the Windows Terminal settings file with an array containing an empty object, a trailing comment, and a comma. Trace the settings JSON parsing path and verify that the same input loads successfully while preserving support for comments and terminating commas.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.