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

Function handleMultiSelectClear

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

Source from the content-addressed store, hash-verified

2912}
2913
2914const handleMultiSelectClear = <A>(options: SelectOptionsReq<A>) =>
2915 Effect.fnUntraced(function*(state: MultiSelectState, _: Action<MultiSelectState, Array<A>>) {
2916 const terminal = yield* Terminal.Terminal
2917 const columns = yield* terminal.columns
2918 const figures = yield* getTheme(options)
2919 const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft
2920 const promptText = renderSelectOutput(figures.prefix, figures.pointerSmall, options, figures, { plain: true })
2921 const choicesText = renderMultiSelectChoices(state, options, figures, { plain: true })
2922 const errorText = renderMultiSelectError(state, figures.pointer, figures, { plain: true })
2923 const clearOutput = clearOutputWithError(withSelectHeader(promptText, choicesText), columns, errorText)
2924 return clearOutput + clearPrompt
2925 })
2926
2927const handleMultiSelectProcess = <A>(options: SelectOptionsReq<A> & MultiSelectOptionsReq) => {
2928 return (input: Terminal.UserInput, state: MultiSelectState) => {

Callers 1

MultiSelectFunction · 0.85

Calls 6

getThemeFunction · 0.85
renderSelectOutputFunction · 0.85
renderMultiSelectChoicesFunction · 0.85
renderMultiSelectErrorFunction · 0.85
clearOutputWithErrorFunction · 0.85
withSelectHeaderFunction · 0.85

Tested by

no test coverage detected