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

Function restoreTerminalModes

apps/kimi-code/src/utils/terminal-restore.ts:20–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18const TERMINAL_RESTORE_SEQUENCE = '\u001B[?25h\u001B[?2004l\u001B[<u\u001B[>4;0m';
19
20export function restoreTerminalModes(): void {
21 try {
22 process.stdin.setRawMode(false);
23 } catch {
24 // ignore — raw mode may not be active, or stdin may not be a TTY.
25 }
26 try {
27 process.stdout.write(TERMINAL_RESTORE_SEQUENCE);
28 } catch {
29 // ignore — the terminal may already be dead (EIO).
30 }
31}

Callers 2

emergencyTerminalExitMethod · 0.90
emergencyExitFunction · 0.90

Calls 2

setRawModeMethod · 0.80
writeMethod · 0.65

Tested by

no test coverage detected