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

Function handleSelectClear

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

Source from the content-addressed store, hash-verified

3606}
3607
3608const handleSelectClear = <A>(options: SelectOptionsReq<A>) =>
3609 Effect.fnUntraced(function*(state: SelectState, _: Action<SelectState, A>) {
3610 const terminal = yield* Terminal.Terminal
3611 const columns = yield* terminal.columns
3612 const figures = yield* getTheme(options)
3613 const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft
3614 const promptText = renderSelectOutput(figures.prefix, figures.pointerSmall, options, figures, { plain: true })
3615 const choicesText = renderSelectChoices(state, options, figures, { plain: true })
3616 const clearOutput = eraseText(withSelectHeader(promptText, choicesText), columns)
3617 return clearOutput + clearPrompt
3618 })
3619
3620const handleAutoCompleteClear = <A>(options: AutoCompleteOptionsReq<A>) =>
3621 Effect.fnUntraced(function*(state: AutoCompleteState, _: Action<AutoCompleteState, A>) {

Callers 1

SelectFunction · 0.85

Calls 5

getThemeFunction · 0.85
renderSelectOutputFunction · 0.85
renderSelectChoicesFunction · 0.85
eraseTextFunction · 0.85
withSelectHeaderFunction · 0.85

Tested by

no test coverage detected