Skip to content

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

@randy3k

Description

@randy3k

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions