(exitCode: number)
| 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) }); |
no test coverage detected