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

another TokenListControl question

Open
#438 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

this already the third TokenListControl question in a week... I hope I am not bothering you :)

I am working on a "list control" using TokenListControl:
List prompt
after the selection is made the list is removed and the question and answer remains...

This all basically works. If I use multiple of these list controls and I resize the terminal window sometimes a line with an already answered question gets lost. I am certain that this issue is caused by how I use prompt-toolkit. I have other probably related issues that I have not investigated enough to describe them here. So my question is how do I control which parts (which TokenListControls) stay on the screen and which parts are cleaned up?

Do I have to call some teardown / cleanup function?

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 by reproducing the issue with multiple TokenListControl list controls and a terminal resize, then inspect how prompt-toolkit handles answered questions and screen cleanup. Determine whether a teardown or cleanup function controls which TokenListControls remain visible, and verify that previously answered lines are preserved after resizing.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
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.