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

Renderer.reset is called 3 times during application startup. #1967

Open
jonathanslenders opened this issue Jan 20, 2025 · 1 comment
Open

Comments

@jonathanslenders
Copy link
Member

This results in some output escape sequences to be produced multiple times without reason, like showing the cursor.

Renderer.reset() is called three times when we create/start an application, like ptpython for instance:

  • Once Application.__init__()-> Renderer.__init__() -> Renderer.reset().
  • Once Application.__init__() -> Application.reset() ->Renderer.reset().
  • Once Application._run_async() -> Application.__init__() -> Application.reset() ->Renderer.reset().

Each time, we call self.output.show_cursor().

Either we should keep track in the Renderer, which terminal state was changed, and only reset that (cursor shapes changed, cursor hidden/shown, alternate screen entered/left, ...) or we should create the Renderer instance only at the point that the application actually starts in Application._run_async(), so that we only reset once.

@jonathanslenders
Copy link
Member Author

Partially fixed by this: #1968

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

1 participant