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

prompt-toolkit based apps (ipdb, ipython) don't work in tox 4 environment

Open
#1,741 0 comments 2 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 discovered that apps based on prompt-toolkit don't work in tox 4 environment properly, initial report in https://github.com/tox-dev/tox/issues/2936

The bug doesn't seem to have any effect on tests themselves, only interactive session used within tox 4.

MWE
# Assuming py311 env has prompt_toolkit installed
tox exec --skip-pkg-install -e py311 -- python3

Simple prompt from documentation is not displayed correctly:

from prompt_toolkit import prompt

text = prompt('Give me some input: ')  # Clears screen, but nothing can be seen only a cursor on first line and correct column.
print('You said: %s' % text)

It seems there is an issue with flushing the screen, but I'm not sure on which part. In docs, I haven't found anything that would help me resolve the problem.

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 MWE with tox exec --skip-pkg-install -e py311 -- python3 and the documented prompt_toolkit.prompt example. Trace the interactive prompt display and screen-flushing path affected by the tox 4 environment. Done means the prompt is visible and accepts input, with the entered text printed correctly.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.