MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / emergencyExit

Function emergencyExit

apps/kimi-code/src/cli/run-shell.ts:160–164  ·  view source on GitHub ↗
(exitCode: number)

Source from the content-addressed store, hash-verified

158 // raw mode with a hidden cursor and XON/XOFF flow control disabled. Restore
159 // both before exiting so the user's shell is usable afterwards.
160 const emergencyExit = (exitCode: number): void => {
161 restoreTerminalModes();
162 restoreStty();
163 process.exit(exitCode);
164 };
165 const onUncaughtException = (error: unknown): void => {
166 try {
167 log.error('uncaughtException, restoring terminal and exiting', { error: String(error) });

Callers 2

onUncaughtExceptionFunction · 0.85
onUnhandledRejectionFunction · 0.85

Calls 3

restoreTerminalModesFunction · 0.90
restoreSttyFunction · 0.85
exitMethod · 0.65

Tested by

no test coverage detected