Repository navigation
End output lines only at CR, LF and CRLF [patch] - #136
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
LineOutputHandler also split on NEL (U+0085), LS (U+2028), PS (U+2029) and form feed, a set carried over from the old ReplaceLineEndings code. Tools emit LS and PS raw inside JSON strings, so NDJSON records were cut in half, and Latin-1 output split at every 0x85 byte. Lines now end where Process.OutputDataReceived and StreamReader.ReadLine end them. Behaviour change: a caller that relied on FF or NEL splitting now gets those characters inside the line. Fixes #133 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW5RAKCxdwrsVmygQDP
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #133
What changed
LineOutputHandler.IsLineBreakalso ended a line at NEL (U+0085), LS (U+2028), PS (U+2029) and form feed. That set came from the oldReplaceLineEndingscode.JSON.stringify,jq -candjson.dumps(ensure_ascii=False)emit LS and PS raw inside strings, so NDJSON records were cut in half, and Latin-1 output was split at every 0x85 byte.Lines now end only at LF, CR and CRLF, which is how
Process.OutputDataReceivedandStreamReader.ReadLinesplit them. The CR handling is unchanged: split CRLF across reads and a held-back trailing CR (#85, #128) work as before.Behaviour change: a caller that relied on FF or NEL splitting now gets those characters inside the line. The commit message records this so it reaches the generated changelog. The README's
LineOutputHandlersection now says which characters end a line.Tests
HandleStandardOutputDataShouldKeepAnUnusualSeparatorInsideTheLine: covers each of LS, PS, NEL and FF inside a JSON record and checks that two records arrive as two lines.HandleStandardErrorDataShouldKeepAnUnusualSeparatorOnAChunkBoundaryInsideTheLine: puts the same characters at the end of a chunk, on the error stream.Ordering note
The triage notes that open #132 and #129 rewrite the same handler. This change touches only
IsLineBreakand its doc comment, so a rebase in either direction should be trivial.Generated by Claude Code