# Listen for CTRL+C (/docs/guides/process/ctrl-c)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 96 · updated: 2026-07-28 -->
Related: [Parse command-line arguments](/docs/guides/process/argv.md), [Spawn a child process and communicate using IPC](/docs/guides/process/ipc.md), [Get the process uptime in nanoseconds](/docs/guides/process/nanoseconds.md), [Listen to OS signals](/docs/guides/process/os-signals.md), [Read stderr from a child process](/docs/guides/process/spawn-stderr.md), [Read stdout from a child process](/docs/guides/process/spawn-stdout.md)

The `ctrl+c` shortcut sends an *interrupt signal* to the running process. Intercept it by listening for the `SIGINT` event. To close the process, you must explicitly call `process.exit()`.

```ts process.ts icon="/icons/typescript.svg"
process.on("SIGINT", () => {
  console.log("Ctrl-C was pressed");
  process.exit();
});
```

***

See [Utils](/runtime/utils) for more utilities.
