()
| 247 | |
| 248 | let rl: readline.Interface | undefined |
| 249 | function on() { |
| 250 | off() |
| 251 | rl = readline.createInterface({ input: stdin, escapeCodeTimeout: 50 }) |
| 252 | readline.emitKeypressEvents(stdin, rl) |
| 253 | if (stdin.isTTY) { |
| 254 | stdin.setRawMode(true) |
| 255 | } |
| 256 | stdin.on('keypress', keypressHandler) |
| 257 | } |
| 258 | |
| 259 | function off() { |
| 260 | rl?.close() |
no test coverage detected