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

Function handleMultiSelectClear

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

Source from the content-addressed store, hash-verified

2689}
2690
2691const handleMultiSelectClear = <A>(options: SelectOptionsReq<A>) =>
2692 Effect.fnUntraced(function*(state: MultiSelectState, _: Action<MultiSelectState, Array<A>>) {
2693 const terminal = yield* Terminal.Terminal
2694 const columns = yield* terminal.columns
2695 const figures = yield* platformFigures
2696 const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft
2697 const promptText = renderSelectOutput("?", figures.pointerSmall, options, { plain: true })
2698 const choicesText = renderMultiSelectChoices(state, options, figures, { plain: true })
2699 const errorText = renderMultiSelectError(state, figures.pointer, { plain: true })
2700 const clearOutput = clearOutputWithError(`${promptText}\n${choicesText}`, columns, errorText)
2701 return clearOutput + clearPrompt
2702 })
2703
2704const handleMultiSelectProcess = <A>(options: SelectOptionsReq<A> & MultiSelectOptionsReq) => {
2705 return (input: Terminal.UserInput, state: MultiSelectState) => {

Callers 1

multiSelectFunction · 0.85

Calls 4

renderSelectOutputFunction · 0.85
renderMultiSelectChoicesFunction · 0.85
renderMultiSelectErrorFunction · 0.85
clearOutputWithErrorFunction · 0.85

Tested by

no test coverage detected