MCPcopy Create free account
hub / github.com/dbcli/mycli / _get_prompt_message

Function _get_prompt_message

mycli/main_modes/repl.py:374–391  ·  view source on GitHub ↗
(
    mycli: 'MyCli',
    app: prompt_toolkit.application.application.Application,
)

Source from the content-addressed store, hash-verified

372
373
374def _get_prompt_message(
375 mycli: 'MyCli',
376 app: prompt_toolkit.application.application.Application,
377) -> FormattedText:
378 if app.current_buffer.text:
379 return mycli.last_prompt_message
380
381 prompt = render_prompt_string(mycli, mycli.prompt_format, app.render_counter)
382 prompt_plain = to_plain_text(prompt)
383 if mycli.prompt_format == mycli.default_prompt and len(prompt_plain) > mycli.max_len_prompt:
384 prompt = render_prompt_string(mycli, mycli.default_prompt_splitln, app.render_counter)
385 prompt_plain = to_plain_text(prompt)
386 mycli.prompt_lines = prompt_plain.count('\n') + 1
387 if not mycli.prompt_lines:
388 mycli.prompt_lines = prompt_plain.count('\n') + 1
389
390 mycli.last_prompt_message = prompt
391 return mycli.last_prompt_message
392
393
394def _get_continuation(

Callers

nothing calls this directly

Calls 1

render_prompt_stringFunction · 0.70

Tested by

no test coverage detected