Skip to content
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

Don't panic when piping #13

Closed
wants to merge 1 commit into from
Closed

Don't panic when piping #13

wants to merge 1 commit into from

Conversation

wfchandler
Copy link

The print! family of macros will panic if they fail to write to stdout/stderr. This condition occurs quite commonly in the terminal when piping to head(1), and displays a messy panic message to the user.

Convert all output to use write!, and ignore any EPIPE errors.

The print! family of macros will panic if they fail to write to
stdout/stderr. This condition occurs quite commonly in the terminal when
piping to `head(1)`, and displays a messy panic message to the user.

Convert all output to use write!, and ignore any EPIPE errors.
@wfchandler wfchandler requested a review from jclulow February 28, 2025 20:27
@jclulow
Copy link
Collaborator

jclulow commented Mar 1, 2025

I just checked, and it remains truly and utterly deranged that the Rust project has been unable to get both arms around the problem of not screwing up SIGPIPE handling on UNIX systems in at least five years; e.g.,

rust-lang/rust#62569

rust-lang/rust#97889

I think rather than rewrite all the I/O to work around this, I'll just work around it with the sigpipe crate for now. I'll get that sorted this afternoon!

@ahl
Copy link

ahl commented Mar 1, 2025

That's neat. Maybe we should use that in the CLI

@jclulow
Copy link
Collaborator

jclulow commented Mar 3, 2025

I put back the sigpipe change: 2d641e8

I've also published an updated Helios package: pkg://helios-dev/text/[email protected]:20250303T182037Z

I've also updated atrium to have this version.

Thanks!

@jclulow jclulow closed this Mar 3, 2025
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.

3 participants