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

Function renderNextFrame

packages/cli/src/internal/prompt/multi-select.ts:155–173  ·  view source on GitHub ↗
(state: State, options: SelectOptions<A>)

Source from the content-addressed store, hash-verified

153}
154
155function renderNextFrame<A>(state: State, options: SelectOptions<A>) {
156 return Effect.gen(function*() {
157 const terminal = yield* Terminal.Terminal
158 const columns = yield* terminal.columns
159 const figures = yield* InternalAnsiUtils.figures
160 const choices = renderChoices(state, options, figures)
161 const leadingSymbol = Doc.annotate(Doc.text("?"), Ansi.cyanBright)
162 const trailingSymbol = Doc.annotate(figures.pointerSmall, Ansi.blackBright)
163 const promptMsg = renderOutput(leadingSymbol, trailingSymbol, options)
164 const error = renderError(state, figures.pointer)
165 return Doc.cursorHide.pipe(
166 Doc.cat(promptMsg),
167 Doc.cat(Doc.hardLine),
168 Doc.cat(choices),
169 Doc.cat(error),
170 Doc.render({ style: "pretty", options: { lineWidth: columns } })
171 )
172 })
173}
174
175function renderSubmission<A>(state: State, options: SelectOptions<A>) {
176 return Effect.gen(function*() {

Callers 1

handleRenderFunction · 0.70

Calls 6

renderChoicesFunction · 0.70
renderOutputFunction · 0.70
renderErrorFunction · 0.70
annotateMethod · 0.65
pipeMethod · 0.65
textMethod · 0.45

Tested by

no test coverage detected