()
| 18 | const TERMINAL_RESTORE_SEQUENCE = '\u001B[?25h\u001B[?2004l\u001B[<u\u001B[>4;0m'; |
| 19 | |
| 20 | export 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 | } |
no test coverage detected