prompt-toolkit / prompt-toolkit/python-prompt-toolkit

More xterm escape codes

Open
#892 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

There are some xterm escape codes which are not handled by prompt_toolkit. These include, but are not limited to, modified (ctrl- / alt- / shift-ctrl- / ...) function keys.
http://aperiodic.net/phil/archives/Geekery/term-function-keys.html
https://www.xfree86.org/current/ctlseqs.html

It is possible to work around this by having key bindings defined as follows, though:

    @kb.add('escape', '[', '1', '5', ';', '5', '~')
    def cf5(event):
        logger.info('c-f5 captured')

Would adding support for some of them be a good idea for a PR?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the xterm escape-code references and the prompt_toolkit key-binding example in the issue, starting with how kb.add handles the shown sequence. Define which modified function keys are in scope and what supported decoding should look like; the issue names no files or tests, and it has no settled implementation target.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.