()
| 188 | |
| 189 | // Cleanup function to restore state |
| 190 | const cleanup = () => { |
| 191 | clearTimeout(timeout) |
| 192 | this.stdin.removeListener("data", onData) |
| 193 | |
| 194 | if (this.stdin.isTTY && wasRaw !== undefined) { |
| 195 | this.stdin.setRawMode(wasRaw) |
| 196 | } |
| 197 | |
| 198 | this.stdin.pause() |
| 199 | this.isPrompting = false |
| 200 | this.afterPrompt() |
| 201 | } |
| 202 | |
| 203 | // Handle incoming data |
| 204 | const onData = (data: Buffer) => { |
nothing calls this directly
no test coverage detected