radicle-heartwood-lfs/crates/radicle-cli/tests/commands
Fintan Halpenny e1f16bee26 term: Catch EPIPE and swallow
Rust (since 1.62) ignores EPIPE by default (see [Rust #62569]),
causing writes to closed pipes to return `io::ErrorKind::BrokenPipe`
errors.  The `println!` macro panics on these errors, producing a
confusing backtrace instead of the silent exit expected of Unix CLI
tools.

To avoid the use of `print!` and `println!`, the `radicle-term`
helper functions use `write!` and `writeln!`. This lays the groundwork
for the `rad` CLI to transition to using only `radicle-term`
functions.

There was a first attempt made, which is documented here.  A
process-wide SIGPIPE reset (`SIG_DFL`) was ruled out because `rad`
manages child processes via libgit2 pipes and communicates with the
radicle node over Unix sockets. Resetting SIGPIPE globally caused
`rad` itself to be killed during internal pipe operations (e.g. during
`rad remote add --fetch`), producing flaky test failures.

[Rust #62569] https://github.com/rust-lang/rust/issues/62569
2026-04-29 10:57:24 +02:00
..
checkout.rs cli/tests: Refactor checkout command tests 2026-03-11 10:51:57 +00:00
clone.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
cob.rs radicle: Refactor COB Storage Access 2026-03-31 17:57:14 +01:00
git.rs cli/tests: Refactor git command tests 2026-03-11 10:51:57 +00:00
id.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
inbox.rs cli/tests: Refactor inbox command tests 2026-03-11 10:51:57 +00:00
init.rs cli/tests: Refactor init command tests 2026-03-11 10:51:57 +00:00
issue.rs cli/tests: Refactor issue command tests 2026-03-11 10:51:57 +00:00
jj.rs cli/tests: Refactor jj command tests 2026-03-11 10:51:57 +00:00
node.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
patch.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
policy.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
remote.rs cli/tests: Refactor remote command tests 2026-03-11 10:51:57 +00:00
sigpipe.rs term: Catch EPIPE and swallow 2026-04-29 10:57:24 +02:00
sync.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
utility.rs rust/edition/fmt: 2021 → 2024 2026-03-30 16:57:51 +02:00
watch.rs cli/tests: Refactor watch command tests 2026-03-11 10:51:57 +00:00
workflow.rs cli/tests: Refactor workflow test 2026-03-11 10:51:57 +00:00