Skip to content

feat(ui): crossplatform terminal resize handling #186

Merged
imsnif merged 1 commit intoimsnif:mainfrom
remgodow:eventresize
Sep 14, 2020
Merged

feat(ui): crossplatform terminal resize handling #186
imsnif merged 1 commit intoimsnif:mainfrom
remgodow:eventresize

Conversation

@remgodow
Copy link
Copy Markdown
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
Copy Markdown
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