MCPcopy Create free account
hub / github.com/Effect-TS/effect / handleClear

Function handleClear

packages/cli/src/internal/prompt/toggle.ts:18–30  ·  view source on GitHub ↗
(options: ToggleOptions)

Source from the content-addressed store, hash-verified

16const renderBeep = Doc.render(Doc.beep, { style: "pretty" })
17
18function 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
32function renderToggle(
33 value: boolean,

Callers 1

toggleFunction · 0.70

Calls 1

pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…