Run the quit cleanup on a plain kill, Ctrl+C and a closing terminal

AI Assisted
This commit is contained in:
Seth committed 2026-12-05 00:10:44 -08:00
1 parent 6a93395148
commit 8c028c1ce0
7 files changed
+458 -3

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
//! Lines for the app's log, its stderr, on the paths a quit takes. `eprintln!` panics when the
//! write fails, as it does once the terminal the app was started from has closed: the quit's
//! cleanup would end at its first line, with the app still open.
use std::io::Write;
/// Writes one line, or nothing when the log cannot be written to.
pub fn line(text: &str) {
let _ = writeln!(std::io::stderr(), "{text}");
}