(s: string | undefined, k: readline.Key)
| 92 | const readInput = Effect.gen(function*() { |
| 93 | const queue = yield* Queue.make<Terminal.UserInput, Cause.Done>() |
| 94 | const handleKeypress = (s: string | undefined, k: readline.Key) => { |
| 95 | const userInput = { |
| 96 | input: Option.fromUndefinedOr(s), |
| 97 | key: { name: k.name ?? "", ctrl: !!k.ctrl, meta: !!k.meta, shift: !!k.shift } |
| 98 | } |
| 99 | Queue.offerUnsafe(queue, userInput) |
| 100 | if (shouldQuit(userInput)) { |
| 101 | Queue.endUnsafe(queue) |
| 102 | } |
| 103 | } |
| 104 | // Deno's `process.stdin` shim does not keep the event loop alive, so a |
| 105 | // program blocked on input can exit before `end` is ever delivered. A |
| 106 | // timer holds the loop open for as long as this reader is active. |
nothing calls this directly
no test coverage detected