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

Function handleSelectClear

packages/effect/src/unstable/cli/Prompt.ts:3370–3380  ·  view source on GitHub ↗
(options: SelectOptionsReq<A>)

Source from the content-addressed store, hash-verified

3368}
3369
3370const handleSelectClear = <A>(options: SelectOptionsReq<A>) =>
3371 Effect.fnUntraced(function*(state: SelectState, _: Action<SelectState, A>) {
3372 const terminal = yield* Terminal.Terminal
3373 const columns = yield* terminal.columns
3374 const figures = yield* platformFigures
3375 const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft
3376 const promptText = renderSelectOutput("?", figures.pointerSmall, options, { plain: true })
3377 const choicesText = renderSelectChoices(state, options, figures, { plain: true })
3378 const clearOutput = eraseText(`${promptText}\n${choicesText}`, columns)
3379 return clearOutput + clearPrompt
3380 })
3381
3382const handleAutoCompleteClear = <A>(options: AutoCompleteOptionsReq<A>) =>
3383 Effect.fnUntraced(function*(state: AutoCompleteState, _: Action<AutoCompleteState, A>) {

Callers 1

selectFunction · 0.85

Calls 3

renderSelectOutputFunction · 0.85
renderSelectChoicesFunction · 0.85
eraseTextFunction · 0.85

Tested by

no test coverage detected