You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Line handler splits output on U+2028, U+2029, NEL (U+0085) and form feed, breaking NDJSON records that OutputDataReceived/ReadLine keep whole #133
privatestaticboolIsLineBreak(charc)=>cis'\n' or '\u0085' or '\u2028' or '\u2029' or '\f';
privatestaticboolIsLineBreak(charc)=>cis'\n' or '\u0085' or '' or '' or '\f';
(used from ProcessDataByLine, lines 139–144). This set came from the original data.ReplaceLineEndings() implementation and was carried over in da03a26 (#85) for compatibility with that code. However Process.OutputDataReceived, StreamReader.ReadLine and essentially every line-oriented tool treat only CR, LF and CRLF as line breaks. No test covers the extra characters.
Why it matters
Those characters are allowed raw inside JSON strings. JSON.stringify, jq -c and Python's json.dumps(..., ensure_ascii=False) all emit U+2028/U+2029 unescaped. So a tool that prints NDJSON (one object per line) gets its records cut in half, and a caller that parses each delivered line as JSON throws.
Add tests showing that output containing U+2028, U+2029, U+0085 and \f is delivered as a single line, including when the character falls on a chunk boundary.
Note the change in the changelog, since anyone relying on FF or NEL splitting will see different behaviour.
Priority: Medium. Line-delimited JSON with raw U+2028 or U+2029, which JSON.stringify and jq -c emit, is split into broken records, and so is any Latin-1 output containing 0x85. The fix changes observable behaviour, so it needs a changelog note as the issue says.
Area / suggested assignment:RunCommand/LineOutputHandler.cs (IsLineBreak, ProcessDataByLine)
Activity
matt-edmondson commentedon Nov 2, 2026
Triage
JSON.stringifyandjq -cemit, is split into broken records, and so is any Latin-1 output containing 0x85. The fix changes observable behaviour, so it needs a changelog note as the issue says.RunCommand/LineOutputHandler.cs(IsLineBreak,ProcessDataByLine)IsLineBreakto\rand\n. Add tests for U+2028, U+2029, U+0085 and\f, including where one falls on a chunk boundary.Generated by Claude Code