diff --git a/src2/app.ts b/src2/app.ts index 5e75e4b..5ca5c13 100644 --- a/src2/app.ts +++ b/src2/app.ts @@ -95,3 +95,14 @@ log.blank() // Start program main().catch(() => process.exit(1)); + +// Exit tasks +['SIGINT', 'SIGTERM'].forEach((signal) => process.addListener(signal as any, () => { + + // Hide ^C in console output + process.stdout.write('\r'); + + // Log then exit + log.info('Exiting', `received ${signal}`); + process.exit(); +}));