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

feat(ui): crossplatform terminal resize handling #186

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

remgodow
Copy link
Contributor

I've found that crossterm emits Event::Resize which can be used instead of sigwinch, it also support Windows, so I refactored resizing logic to support all platforms.

Copy link
Owner

@imsnif imsnif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! Only unfortunate part is that on linux/mac we'd needlessly doing a system call to check the terminal size: https://github.com/crossterm-rs/crossterm/blob/63267957003130b616e6132feb51de941652ce94/src/event/source/unix.rs#L140
But hey, since it'd be saving us a thread, I'm game. :)

@imsnif imsnif merged commit e8a3f31 into imsnif:main Sep 14, 2020
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 this pull request may close these issues.

2 participants