-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console.Unix: fix OpenStandardInput Stream sometimes throwing for Reads. #62153
Conversation
When connected to a terminal reads happen line-by-line. StdInReader caches the line in a StringBuilder. Instead of returning when the destination buffer is full, an attempt was made to decode the next chunk from the StringBuilder (if there is one). This causes the encoder to throw for encoding into an empty buffer.
Tagging subscribers to this area: @dotnet/area-system-console Issue DetailsWhen connected to a terminal reads happen line-by-line. StdInReader caches the line in a StringBuilder. Instead of returning when the destination buffer is full, an attempt Fixes #61865. @dotnet/area-system-console ptal. cc @dmbarbour
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmds thank you for your contribution! I've left some comments, PTAL
Adam, thank you for reviewing! I've addressed your feedback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tmds thank you for addressing the feedback, LGTM.
When connected to a terminal reads happen line-by-line.
This was added in .NET 5 by #39192.
StdInReader caches the line in a StringBuilder.
Instead of returning when the destination buffer is full, an attempt
was made to decode the next chunk from the StringBuilder (if there is
one). This causes the encoder to throw for encoding into an empty buffer.
Fixes #61865.
@dotnet/area-system-console ptal.
cc @dmbarbour