Skip to content

stdio: make stdout block-buffered when not associated to a terminal#148274

Draft
andreacorbellini wants to merge 1 commit into
rust-lang:mainfrom
andreacorbellini:stdout-buffering
Draft

stdio: make stdout block-buffered when not associated to a terminal#148274
andreacorbellini wants to merge 1 commit into
rust-lang:mainfrom
andreacorbellini:stdout-buffering

Conversation

@andreacorbellini

Copy link
Copy Markdown

This changes std::io::Stdout so that:

  • it is line-buffered when connected to a terminal
  • it is block-buffered otherwise

This matches the behavior of standard library implementations from other popular languages (C/C++/Python just to name a few).

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Oct 30, 2025
@rustbot

rustbot commented Oct 30, 2025

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@andreacorbellini

Copy link
Copy Markdown
Author

This PR seems to have discovered an interesting bug. Reported at #148278

@the8472

the8472 commented Oct 30, 2025

Copy link
Copy Markdown
Member

Please see #60673 for prior discussion

@andreacorbellini andreacorbellini marked this pull request as draft November 1, 2025 02:23
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-windows Operating system: Windows S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants