prompt doesn't show in docker image (2.0 branch)
See original GitHub issueI 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
prompt doesn't show in docker image (2.0 branch) #625 - GitHub
I was trying to run my application on a python docker container but the prompt is not shown. Here is a simple way...
Read more >Add git branch name on bash command prompt in docker ...
I add the same code to docker container ~/.bashrc when making docker image. However, it only colored the current directory but not showing...
Read more >Developing inside a Container - Visual Studio Code
Developing inside a Container. The Visual Studio Code Dev Containers extension lets you use a Docker container as a full-featured development environment.
Read more >Docker@2 - Docker v2 task - Microsoft Learn
Build or push Docker images, login or logout, start or stop containers, or run a Docker command.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found a hacky solution from stackoverflow
I think prompt toolkit should nevertheless be able to handle the case of tty not getting the terminal size correctly.