Skip to content

Avoid redirecting process output#53539

Open
tmat wants to merge 1 commit intodotnet:release/10.0.3xxfrom
tmat:ConsoleInput
Open

Avoid redirecting process output#53539
tmat wants to merge 1 commit intodotnet:release/10.0.3xxfrom
tmat:ConsoleInput

Conversation

@tmat
Copy link
Member

@tmat tmat commented Mar 19, 2026

Redirecting output causes the process console to not be created.

Fixes #53091

@tmat tmat requested a review from a team as a code owner March 19, 2026 17:10
Copilot AI review requested due to automatic review settings March 19, 2026 17:10
Copy link
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

This PR aims to fix dotnet watch running console applications that use cursor/clear Console APIs (e.g., Console.Clear()) by avoiding stdout/stderr redirection, since redirected standard handles aren’t console handles and can cause System.IO.IOException: The handle is invalid.

Changes:

  • Stop wiring the default process output forwarding (ProcessOutputReporter) for user app processes in non-test runs.
  • Keep output redirection/forwarding behavior only when TestFlags.RunningAsTest is set.

@tmat tmat marked this pull request as draft March 19, 2026 17:43
@tmat tmat marked this pull request as ready for review March 19, 2026 19:03
@tmat
Copy link
Member Author

tmat commented Mar 19, 2026

@DustinCampbell ptal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants