The best way to control Claude Code, Codex and more from any computer or phone

main
ts 26 lines 953 Bytes
Raw
1 // Relative import (not `@/` alias) so this fixture runs as a bare bun/node
2 // child without a paths-aware loader. Excluded from the test project's
3 // typecheck (see tsconfig.test.json) because the relative path crosses
4 // composite-project boundaries.
5 import * as Effect from "effect/Effect";
6 import {
7 installShutdownFeedback,
8 suppressInterruptMessages,
9 } from "../../../src/Cli/commands/errors.ts";
10
11 if (process.env.SHUTDOWN_FIXTURE_SUPPRESS === "1") {
12 Effect.runSync(suppressInterruptMessages);
13 }
14 Effect.runSync(installShutdownFeedback);
15
16 // Simulates a teardown that takes this long after the first SIGINT. Without
17 // it the fixture never exits on its own (a hanging cleanup).
18 const exitAfter = Number.parseInt(process.env.SHUTDOWN_FIXTURE_EXIT_AFTER_MS ?? "", 10);
19 if (Number.isFinite(exitAfter)) {
20 process.once("SIGINT", () => {
21 setTimeout(() => process.exit(0), exitAfter);
22 });
23 }
24
25 console.log("ready");
26 setInterval(() => {}, 1000);