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"