Skip to content

Commit c8a7386

Browse files
kjkclaude
andcommitted
cmd/run.ts: launch SumatraPDF detached, don't wait for it to exit
Bun keeps the script alive until a spawned child exits, so `bun cmd/run.ts` hung until SumatraPDF was closed. unref() the subprocess (and ignore its stdio) so the script returns as soon as the app is launched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 6689705 commit c8a7386

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/run.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ async function main() {
2727
console.log(`build took ${elapsed}s`);
2828

2929
const path = join("out", "dbg64", "SumatraPDF-dll.exe");
30-
Bun.spawn([path], {
30+
// launch and detach: don't keep this script alive waiting for SumatraPDF to exit
31+
const proc = Bun.spawn([path], {
3132
cwd: ".",
33+
stdin: "ignore",
34+
stdout: "ignore",
35+
stderr: "ignore",
3236
});
37+
proc.unref();
3338
}
3439

3540
await main();

0 commit comments

Comments
 (0)