Skip to content

Commit 53b0ac0

Browse files
koki-developclaude
andcommitted
fix: Hide exit warning before termination on double Ctrl+C
- Use setTimeout to wait for React re-render before calling exit() - Prevents exit warning from remaining visible during shutdown - Ensures clean UI state when application terminates 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 419d6d8 commit 53b0ac0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/App.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,13 @@ export const App: React.FC<AppProps> = ({ safeMode }) => {
3838
timeoutRef.current = null;
3939
}, 3000);
4040
} else {
41-
// Second Ctrl+C within timeout - exit immediately
41+
// Second Ctrl+C within timeout - hide warning and exit after re-render
4242
if (timeoutRef.current) {
4343
clearTimeout(timeoutRef.current);
4444
}
45-
exit();
45+
setShowExitWarning(false);
46+
// Wait for re-render before exiting
47+
setTimeout(() => exit(), 0);
4648
}
4749
} else if (showExitWarning) {
4850
// Cancel Ctrl+C exit when any other input is detected

0 commit comments

Comments
 (0)