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

Support for resizing the terminal #1

Open
NthStarFarer opened this issue Aug 29, 2023 · 1 comment · May be fixed by #2
Open

Support for resizing the terminal #1

NthStarFarer opened this issue Aug 29, 2023 · 1 comment · May be fixed by #2

Comments

@NthStarFarer
Copy link

Currently, resizing the terminal while playing doesn't cause the video to resize, and results in a lot of artifacts that don't necessarily go away even when set back to the original size. It would be nice to be able to react to this and change the resolution dynamically to keep the output clean.

@NthStarFarer
Copy link
Author

I'm currently working on basic support for this, but I still have a few issues. The plan is to listen for SIGWINCH using signal-hook, and to inform the Producer of the resolution change. When frames at the new resolution start to arrive (not necessarily the next frame, due to buffering), then the producer sends a message to indicate that the resolution change has happened and all new frames will arrive at the new resolution (currently this message is just the Initialize message again, since it already causes the main loop to create a new renderer with the correct resolution).

There's still room for optimisation though, and clearing the screen still seems to cause a small amount of artifacting. Plus SIGWINCH is not available on windows, so the current version breaks compatability.

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.

1 participant