()
| 1 | export function restoreTerminalState(): void { |
| 2 | if (process.stdout.isTTY) { |
| 3 | // Disable kitty keyboard protocol / CSI u key release reporting if enabled. |
| 4 | process.stdout.write('\x1b[>4;0m'); |
| 5 | // Disable focus reporting to avoid stray ^[[I on mode switches. |
| 6 | process.stdout.write('\x1b[?1004l'); |
| 7 | process.stdout.write('\x1b[?2004l'); |
| 8 | } |
| 9 | if (process.stdin.isTTY) { |
| 10 | try { |
| 11 | process.stdin.setRawMode(false); |
| 12 | } catch { |
| 13 | // Ignore if raw mode is not supported. |
| 14 | } |
| 15 | } |
| 16 | } |
no test coverage detected