Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Listen for CTRL+C - Bun
[go: Go Back, main page]

Skip to main content
The ctrl+c shortcut sends an interrupt signal to the running process. This signal can be intercepted by listening for the SIGINT event. If you want to close the process, you must explicitly call process.exit().
https://mintcdn.com/bun-1dd33a4e/nIz6GtMH5K-dfXeV/icons/typescript.svg?fit=max&auto=format&n=nIz6GtMH5K-dfXeV&q=85&s=5d73d76daf7eb7b158469d8c30d349b0process.ts
process.on("SIGINT", () => {
  console.log("Ctrl-C was pressed");
  process.exit();
});

See Docs > API > Utils for more useful utilities.