Files
2026-08-27 21:09:14 +00:00

19 lines
461 B
Plaintext

---
title: Listen for CTRL+C
sidebarTitle: Listen for CTRL+C
mode: center
---
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.