prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Let the multiline filter have access to the prompt text
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
Right now there's no simple way to decide whether Enter should accept or open a new line based on the content of the text.
It seems like a very useful feature in general. For example, to write something like ptpython (that doesn't seem to use this feature)
Please correct me if I'm wrong about that.
Also, right now is_true(self.multiline) is called about 10 times for each character pressed. You really only need to call it once.
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 by locating the multiline filter and the code path that handles Enter, then trace how the current is_true(self.multiline) checks are performed. Determine how prompt text could be exposed to that decision and where the repeated check can be consolidated. Done means the filter can decide based on the current text and the redundant per-character evaluations are removed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100