prompt-toolkit / prompt-toolkit/python-prompt-toolkit
[feature] support c-enter/c-s-enter/s-enter
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
showkey -a display:
- Shift + Enter:
^[[27;2;13~ - Control + Enter:
^[[27;5;13~ - Control + Shift + Enter:
^[[27;6;13~
First, prompt-toolkit miss c-enter, s-enter, ...
Second, Even if I
@add_key_binding(*["escape", "[27;2;13~"])
def _(event: KeyPressEvent) -> None:
print("hi")
It still cannot work.
Weirdly, the following keys can work.
- Alt + Control + Enter
- Alt + Control + Shift + Enter
@add_key_binding(["escape", *"[27;8;13~"])
def _(event: KeyPressEvent) ->None:
print("hi")
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
Reproduce the reported sequences with showkey -a, then trace prompt-toolkit's key binding and escape-sequence handling for c-enter, s-enter, and c-s-enter. Done means these sequences can be registered with add_key_binding and invoke their handlers, including the forms shown in the issue.
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
- Mostly clear
- Newbie friendliness
- 35/100