WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Redraw the screen if the terminal size changes #58

@JohnSchmeichel

Description

@JohnSchmeichel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions