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

Function handleAutoCompleteClear

packages/effect/src/cli/Prompt.ts:3620–3637  ·  view source on GitHub ↗
(options: AutoCompleteOptionsReq<A>)

Source from the content-addressed store, hash-verified

3618 })
3619
3620const handleAutoCompleteClear = <A>(options: AutoCompleteOptionsReq<A>) =>
3621 Effect.fnUntraced(function*(state: AutoCompleteState, _: Action<AutoCompleteState, A>) {
3622 const terminal = yield* Terminal.Terminal
3623 const columns = yield* terminal.columns
3624 const figures = yield* getTheme(options)
3625 const clearPrompt = Ansi.eraseLine + Ansi.cursorLeft
3626 const promptText = renderAutoCompleteOutput(
3627 state,
3628 figures.prefix,
3629 figures.pointerSmall,
3630 options,
3631 figures,
3632 { plain: true }
3633 )
3634 const choicesText = renderAutoCompleteChoices(state, options, figures, { plain: true })
3635 const clearOutput = eraseText(`${promptText}\n${choicesText}`, columns)
3636 return clearOutput + clearPrompt
3637 })
3638
3639const handleSelectProcess = <A>(options: SelectOptionsReq<A>) => {
3640 return (input: Terminal.UserInput, state: SelectState) => {

Callers 1

AutoCompleteFunction · 0.85

Calls 4

getThemeFunction · 0.85
renderAutoCompleteOutputFunction · 0.85
eraseTextFunction · 0.85

Tested by

no test coverage detected