Console.Unix: fix OpenStandardInput Stream sometimes throwing for Reads.#62153
Console.Unix: fix OpenStandardInput Stream sometimes throwing for Reads.#62153adamsitnik merged 3 commits intodotnet:mainfrom
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
|
adamsitnik
left a comment
There was a problem hiding this comment.
@tmds thank you for your contribution! I've left some comments, PTAL
|
Adam, thank you for reviewing! I've addressed your feedback. |
adamsitnik
left a comment
There was a problem hiding this comment.
@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