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

Method emergencyTerminalExit

apps/kimi-code/src/tui/kimi-tui.ts:868–876  ·  view source on GitHub ↗
(exitCode = 129)

Source from the content-addressed store, hash-verified

866
867 // Exit codes follow POSIX 128+signum: 129 = SIGHUP, 143 = SIGTERM.
868 private emergencyTerminalExit(exitCode = 129): never {
869 this.isShuttingDown = true;
870 this.unregisterSignalHandlers();
871 // Best-effort terminal restore: stop() may not have run (SIGHUP) or may
872 // have thrown (SIGTERM cleanup failure), so recover raw mode / cursor /
873 // bracketed paste before exiting instead of leaving the user's shell broken.
874 restoreTerminalModes();
875 process.exit(exitCode);
876 }
877
878 private disposeTerminalTracking(): void {
879 this.stopTerminalThemeTracking();

Callers 2

handlerMethod · 0.95
terminalErrorHandlerMethod · 0.95

Calls 3

restoreTerminalModesFunction · 0.90
exitMethod · 0.65

Tested by

no test coverage detected