@@ -55,6 +55,8 @@ export const useExitHandler = ({
5555 }
5656 exitScheduledRef . current = true
5757
58+ console . log ( '[exit-handler] exitNow invoked' )
59+
5860 if ( exitWarningTimeoutRef . current ) {
5961 clearTimeout ( exitWarningTimeoutRef . current )
6062 exitWarningTimeoutRef . current = null
@@ -101,18 +103,21 @@ export const useExitHandler = ({
101103 }
102104
103105 if ( ! nextCtrlCWillExit ) {
106+ console . log ( '[exit-handler] first Ctrl+C detected; showing warning' )
104107 setNextCtrlCWillExit ( true )
105108 exitWarningTimeoutRef . current = setTimeout ( ( ) => {
106109 setNextCtrlCWillExit ( false )
107110 exitWarningTimeoutRef . current = null
108111 } , 2000 )
109112 // Fallback: if a second Ctrl+C is not detected, exit after a short grace period
110113 exitFallbackTimeoutRef . current = setTimeout ( ( ) => {
114+ console . log ( '[exit-handler] fallback exit triggered after warning window' )
111115 exitNow ( )
112116 } , 1200 )
113117 return true
114118 }
115119
120+ console . log ( '[exit-handler] second Ctrl+C detected; exiting' )
116121 // Fire-and-forget analytics flush so exit is not blocked
117122 void flushAnalyticsWithTimeout ( )
118123 exitNow ( )
@@ -121,6 +126,7 @@ export const useExitHandler = ({
121126
122127 useEffect ( ( ) => {
123128 const handleSigint = ( ) => {
129+ console . log ( '[exit-handler] SIGINT received; exiting' )
124130 void flushAnalyticsWithTimeout ( )
125131 exitNow ( )
126132 }
0 commit comments