Skip to content

Clarify that DataReceivedEventArgs.Data is null at end of stream#12657

Open
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-final-newline-detection
Open

Clarify that DataReceivedEventArgs.Data is null at end of stream#12657
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-final-newline-detection

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 25, 2026

Process.OutputDataReceived/ErrorDataReceived raise a final event with Data == null when the redirected stream closes, but this wasn't clearly documented—making it impossible to distinguish "no trailing newline" from "end of stream" without reading the source.

  • Updated DataReceivedEventArgs.Data <value> to state the property is null at end of stream
  • Added explicit paragraph to both OutputDataReceived and ErrorDataReceived remarks noting the null-data end-of-stream signal

Copilot AI changed the title [WIP] Fix final newline detection in OutputDataReceived Clarify that DataReceivedEventArgs.Data is null at end of stream May 25, 2026
Copilot AI requested a review from adamsitnik May 25, 2026 17:24
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 25, 2026
@adamsitnik adamsitnik marked this pull request as ready for review May 26, 2026 16:50
@adamsitnik adamsitnik requested a review from a team as a code owner May 26, 2026 16:50
Copilot AI review requested due to automatic review settings May 26, 2026 16:50
@adamsitnik adamsitnik removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label May 26, 2026
Copy link
Copy Markdown
Member

@adamsitnik adamsitnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process

@adamsitnik adamsitnik enabled auto-merge (squash) May 26, 2026 16:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Clarifies that DataReceivedEventArgs.Data is null when the redirected stream reaches end-of-stream, and documents the same end-of-stream signaling behavior on Process.OutputDataReceived and Process.ErrorDataReceived event remarks.

Changes:

  • Updates the <value> of DataReceivedEventArgs.Data to note the value is null at end of stream.
  • Adds a paragraph to Process.ErrorDataReceived remarks describing the null-data end-of-stream event.
  • Adds the analogous paragraph to Process.OutputDataReceived remarks.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
xml/System.Diagnostics/DataReceivedEventArgs.xml Extends the Data property's <value> text to state it is null at end of stream.
xml/System.Diagnostics/Process.xml Adds end-of-stream/null-data clarification paragraphs to ErrorDataReceived and OutputDataReceived remarks.

Copy link
Copy Markdown
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor wording suggestion.

Comment thread xml/System.Diagnostics/DataReceivedEventArgs.xml Outdated
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System.Diagnostics.Process.OutputDataReceived - determine final newline

4 participants