Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textual in docker containers #5231

Closed
gabriele-costa opened this issue Nov 13, 2024 · 4 comments
Closed

Textual in docker containers #5231

gabriele-costa opened this issue Nov 13, 2024 · 4 comments

Comments

@gabriele-costa
Copy link

When running Textual apps in docker containers strange characters appear on screen.

Minimal Dockerfile to reproduce

FROM python:3.9-slim

RUN pip install textual textual-dev

COPY main.py main.py

CMD ["python3", "main.py"]

Where main.py contains

from textual.app import App
from textual.widgets import Button

class Test(App):
    def compose(self):
        yield Button("Hi")

if __name__ == "__main__":
    Test().run()

When moving the mouse pointer over the terminal, numbers appear. They seem like screen coordinates.

Copy link

We found the following entries in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@TomJGooding
Copy link
Contributor

Those strange characters are the ANSI escape sequences that control the terminal.

I'm not super familiar with docker, but how are you running the container? For example, are you using the i (interactive) or t (tty) flags?

@gabriele-costa
Copy link
Author

You are right, the -t flag apparently solved the issue (which perfectly makes sense since the terminal type clearly matters). Thank you very much for your kind and prompt answer

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants