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

s-tab support for TERM linux

Open
#1,294 1 comment 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

I wrote an application I want to be as portable as possible. Found that s-tab didn't work in the linux console (TERM=linux). Found a great article talking about how linux doesn't match ANSI/VT for everything: https://unix.stackexchange.com/a/238932

I have provided a pull request that will simply add an additional escape sequence to prompt_toolkit.input.ansi_escape_sequences that works. (Rename to .py. Import. Call patch() within.)

Until a fix is incorporated and released, I'm using the attached file as a workaround, as I'd like to not have an application dependency on a non-released (ie, pypi) version of prompt-toolkit.

patch_for_linux.txt

Putting up this issue and not just submitting a pull request for a couple of reasons.

First, is the patch in my pull request the best way to implement this? Shouldn't break anything as far as I know, and seems to already be TERM=linux alternative sequences in there already.

Second, any value to having prompt-toolkit read TERM and build ANSI_SEQUENCES dynamically based on that?

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

Start with prompt_toolkit.input.ansi_escape_sequences and inspect the attached patch_for_linux.txt, paying attention to the existing TERM=linux alternatives. Determine whether the additional escape sequence is sufficient or whether TERM-specific sequence construction is needed. Done means s-tab works in the Linux console without breaking existing terminal input behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.