> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 监听 CTRL+C

`ctrl+c` 快捷键会向正在运行的进程发送一个 *中断信号*。该信号可以通过监听 `SIGINT` 事件来捕获。如果你想关闭进程，必须显式调用 `process.exit()`。

```ts process.ts icon="https://mintcdn.com/bun-zhcndoc/cnUTwgMuf4cCrwC-/icons/typescript.svg?fit=max&auto=format&n=cnUTwgMuf4cCrwC-&q=85&s=e7767043c9e885c34f2d6c8fe2a95217" theme={"theme":{"light":"github-light","dark":"dracula"}}
process.on("SIGINT", () => {
  console.log("Ctrl-C was pressed");
  process.exit();
});
```

***

更多实用工具请参见 [文档 > API > Utils](/runtime/utils)。
