| 16 | const renderBeep = Doc.render(Doc.beep, { style: "pretty" }) |
| 17 | |
| 18 | function handleClear(options: ToggleOptions) { |
| 19 | return Effect.gen(function*() { |
| 20 | const terminal = yield* Terminal.Terminal |
| 21 | const columns = yield* terminal.columns |
| 22 | const clearPrompt = Doc.cat(Doc.eraseLine, Doc.cursorLeft) |
| 23 | const clearOutput = InternalAnsiUtils.eraseText(options.message, columns) |
| 24 | return clearOutput.pipe( |
| 25 | Doc.cat(clearPrompt), |
| 26 | Optimize.optimize(Optimize.Deep), |
| 27 | Doc.render({ style: "pretty", options: { lineWidth: columns } }) |
| 28 | ) |
| 29 | }) |
| 30 | } |
| 31 | |
| 32 | function renderToggle( |
| 33 | value: boolean, |