Skip to content

Re-enable the InPeek manual test on Windows - #134376

Open
caraioniurie47 wants to merge 1 commit into
dotnet:mainfrom
caraioniurie47:issue-40735
Open

caraioniurie47 wants to merge 1 commit into
dotnet:mainfrom
caraioniurie47:issue-40735

Conversation

@caraioniurie47

Copy link
Copy Markdown
Contributor

ConsoleManualTests.InPeek has carried [ActiveIssue] on Windows for #40735: once Console.In had read a line, Console.In.Peek() returned -1. The cause was in StreamReader.Peek(), fixed by #89609 in .NET 8; the analysis is in #40735 (comment). This removes the attribute.

Tests

Manual tests don't run in CI. ReadLineFromOpenStandardInput and InPeek were run with xunit.console in a console window on a local build, in that order, which is the order xunit uses for the whole class, so InPeek runs after Console.ReadLine() has read a line. Both passed.

This removes the line next to the manual test added in #133896, so whichever of the two merges second needs a small merge.

Resolves #40735

Note

AI-generated, written at my direction and reviewed by me before posting. Both tests ran on Windows 11 x64 (build 26200), inbox conhost, Debug libraries, with the keys typed into the console by another process (AttachConsole + WriteConsoleInput) rather than by hand.

InPeek was disabled on Windows for dotnet#40735: once Console.In had read a
line, Console.In.Peek() returned -1. StreamReader.Peek() returned -1
without reading whenever its buffer was empty and the previous read
had been shorter than the buffer. dotnet#89609 removed that condition in
.NET 8.

InPeek now passes on Windows, run after ReadLineFromOpenStandardInput
as xunit orders the class.

Fix dotnet#40735

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Sep 21, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-console
See info in area-owners.md if you want to be subscribed.

This branch has not been deployed

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

Labels

area-System.Console community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console.In.Peek() always returning EOF after the first read line on Windows

1 participant