prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Question how to print some text under prompt like bash autocomplete
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
kb = KeyBindings()
@kb.add('tab')
def _(event):
buff = event.app.current_buffer
if buff.text != '':
# do some search and how to print result in multi lines?
print()
session = PromptSession()
session.prompt('test> ', key_bindings=kb)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the KeyBindings callback and PromptSession usage shown in the issue, focusing on how output from the Tab handler interacts with the active prompt. Determine the supported way to display multi-line search results below the prompt, then verify it with a small interactive example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100