From a20c3ea6bf69f85b7c093336481b577d64aa12d8 Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Tue, 5 Nov 2024 08:07:36 +0100 Subject: [PATCH] typstwatch: don't open half written files --- scripts/typstwatch.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/typstwatch.sh b/scripts/typstwatch.sh index 56f1ed1..75be955 100755 --- a/scripts/typstwatch.sh +++ b/scripts/typstwatch.sh @@ -4,6 +4,8 @@ trap 'kill $(jobs -p); rm "$tmpf"' EXIT typst watch "$1" "$tmpf" "${@:2}" & -while [ ! -f "$tmpf" ]; do sleep 1; done + # Without this, zathura may try to open a half-written file. This is a hack, but I don't know of a + # better approach. +sleep 1 zathura "$tmpf"