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

Escape sequences after exiting app with run(mouse=False) #4376

Closed
TomJGooding opened this issue Apr 1, 2024 · 4 comments · Fixed by #4379
Closed

Escape sequences after exiting app with run(mouse=False) #4376

TomJGooding opened this issue Apr 1, 2024 · 4 comments · Fixed by #4379

Comments

@TomJGooding
Copy link
Contributor

I found this while experimenting with the new mouse parameter added to App.run in Textual v0.55.0.

Try exiting the app below and then moving the mouse in your terminal:

from textual.app import App


class ExampleApp(App):
    pass


if __name__ == "__main__":
    app = ExampleApp()
    app.run(mouse=False)
Copy link

github-actions bot commented Apr 1, 2024

We found the following entry 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 Author

Actually if you try moving your mouse around for a few seconds while the app is running, it will crash with:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x82 in position 4: invalid start byte

@mzebrak
Copy link

mzebrak commented Apr 2, 2024

Maybe worth knowing:
I also noticed the run_async default behavior has changed. By default it now has mouse=False, so launching as a regular TUI app result in the same error as @TomJGooding mentioned.

Of course, it's easily fixable but brought me some questions as I haven't noticed anything related in the latest release note. And noticed that, because we use it like asyncio.run(app.run_async()) instead of app.run() because of the need for our own event loop (apart from that, I don't see anything wrong with it since it's a public interface)

Copy link

github-actions bot commented Apr 2, 2024

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

Successfully merging a pull request may close this issue.

2 participants