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

prompt doesn't show in docker image (2.0 branch)

Open
#625 6 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

I was trying to run my application on a python docker container but the prompt is not shown. Here is a simple way to reproduce it.

docker pull python
docker run --name python -dit python
docker exec -it python /bin/bash

then in the container, install prompt_toolkit

pip install git+https://github.com/jonathanslenders/python-prompt-toolkit

a simple script test.py

from prompt_toolkit import prompt

print("enter something")
text = prompt("> ")
print("you entered %s." % text)

run the script and enter "foo"

root@2084abd7fdb1:/# python test.py
enter something
you entered foo.

Note that the prompt was not shown in above.
Interestingly, it works again if I reset the terminal

root@2084abd7fdb1:/# reset
root@2084abd7fdb1:/# python test.py
enter something
> bar
you entered bar.

BTW, I am using macOS iTerm if it matters.

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 the listed Docker commands, prompt_toolkit installation, and test.py entry point, both before and after running reset. The payload names no source file or test; trace the prompt path responsible for terminal display. Done means the prompt is visible in the reported container scenario without requiring reset.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, 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.