Repository navigation
CLI: a closed stdout ends vectorcraft-cli quietly - #181
Merged
Merged
Conversation
`vectorcraft-cli commands | head -1` panicked and exited with status 101: thread 'main' panicked at library/std/src/io/stdio.rs:1168:9: failed printing to stdout: Broken pipe (os error 32) println! and print! panic when stdout is closed. Output now goes through outln! and out!, which end the program with status 0 on a broken pipe (the reader has what it wanted) and report any other write error on stderr with status 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
|
Thanks @japbcoelho, merged! If you're not already there, come say hi in our Discord, we'd love to have you: https://discord.gg/artcraft |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
vectorcraft-cli commands | head -1panicked and exited with status 101:println!andprint!panic when stdout is closed. The CLI now prints throughoutln!andout!: a broken pipe ends the program with status 0, since the reader already has what it wanted, and any other write error goes to stderr with status 1. storytold/designcraft#43 makes the same change in DesignCraft.How it was tested
closed_stdout_ends_quietlyinapps/vectorcraft-cli/tests/cli.rsreads the first 16 bytes ofcommands, about 270 KB in all, and closes the pipe. It fails on main2c02502and passes with the fix.Checklist
cargo xtask cipasses (fmt, clippy, tests, assets, brands, layers, wasm).unwrap(),expect(),panic!,unreachable!,todo!orunimplemented!outside tests, and no unchecked indexing on data from files, parameters ormessages. Errors are returned as
Resultand shown to the user(why and how).
ASSETS.md(no new assets).🤖 Generated with Claude Code