summaryrefslogtreecommitdiff
path: root/crates/typst-cli
diff options
context:
space:
mode:
Diffstat (limited to 'crates/typst-cli')
-rw-r--r--crates/typst-cli/Cargo.toml1
-rw-r--r--crates/typst-cli/src/main.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/crates/typst-cli/Cargo.toml b/crates/typst-cli/Cargo.toml
index 8f1407d6..4b4abc55 100644
--- a/crates/typst-cli/Cargo.toml
+++ b/crates/typst-cli/Cargo.toml
@@ -46,6 +46,7 @@ serde = { workspace = true }
serde_json = { workspace = true }
serde_yaml = { workspace = true }
shell-escape = { workspace = true }
+sigpipe = { workspace = true }
tar = { workspace = true }
tempfile = { workspace = true }
toml = { workspace = true }
diff --git a/crates/typst-cli/src/main.rs b/crates/typst-cli/src/main.rs
index 631befe5..e4861d6f 100644
--- a/crates/typst-cli/src/main.rs
+++ b/crates/typst-cli/src/main.rs
@@ -44,6 +44,10 @@ static ARGS: LazyLock<CliArguments> = LazyLock::new(|| {
/// Entry point.
fn main() -> ExitCode {
+ // Handle SIGPIPE
+ // https://stackoverflow.com/questions/65755853/simple-word-count-rust-program-outputs-valid-stdout-but-panicks-when-piped-to-he/65760807
+ sigpipe::reset();
+
let res = dispatch();
if let Err(msg) = res {