(s: string | undefined, k: readline.Key)
| 48 | yield* RcRef.get(rlRef) |
| 49 | const mailbox = yield* Mailbox.make<Terminal.UserInput>() |
| 50 | const handleKeypress = (s: string | undefined, k: readline.Key) => { |
| 51 | const userInput = { |
| 52 | input: Option.fromNullable(s), |
| 53 | key: { name: k.name ?? "", ctrl: !!k.ctrl, meta: !!k.meta, shift: !!k.shift } |
| 54 | } |
| 55 | mailbox.unsafeOffer(userInput) |
| 56 | if (shouldQuit(userInput)) { |
| 57 | mailbox.unsafeDone(Exit.void) |
| 58 | } |
| 59 | } |
| 60 | yield* Effect.addFinalizer(() => Effect.sync(() => stdin.off("keypress", handleKeypress))) |
| 61 | stdin.on("keypress", handleKeypress) |
| 62 | return mailbox as Mailbox.ReadonlyMailbox<Terminal.UserInput> |
nothing calls this directly
no test coverage detected