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

Redraw the screen if the terminal size changes #58

Open
JohnSchmeichel opened this issue Mar 25, 2023 · 0 comments
Open

Redraw the screen if the terminal size changes #58

JohnSchmeichel opened this issue Mar 25, 2023 · 0 comments

Comments

@JohnSchmeichel
Copy link
Contributor

If the terminal window size changes the app does not redraw until the next input event. This works but is a bit clunky. On *nix there is SIGWINCH which gets sent, but Windows doesn't have a nice equivalent here. There is ReadConsoleInput which will receive a WINDOW_BUFFER_SIZE_RECORD on changes to the screen buffer (which generally maps to window size changes). Unfortunately, using ReadConsoleInput means all stdin usage needs to go through this and can't be mixed with Console.ReadKey(). Example usage on ReadConsoleInput.

Consider adding a console service abstraction and provide platform specific implementations to both allow Windows specific events to be used, and a natural place to put platform specific initialization like Win32Console. Would likely require custom VT parsing.

More info from the Windows Terminal in microsoft/terminal#281 microsoft/terminal#305 microsoft/terminal#14958

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