-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
catch resize events on windows #1961
Comments
At one point I was researching terminal resize on Windows given the lack of SIGWINCH and found this: This is the part that caught my eye: pub fn has_window_size_changed() -> bool {
let mut buf: [INPUT_RECORD; 1024] = [Default::default(); 1024];
let mut read: u32 = 0;
unsafe {
PeekConsoleInputW(
std::os::windows::io::AsRawHandle::as_raw_handle(&HandleRef::stdin()),
buf.as_mut_ptr(), 1024, &mut read)
};
return buf.iter().any(|x| x.EventType == WINDOW_BUFFER_SIZE_EVENT);
} I don't recall exactly which search terms, GitHub issues/PRs, etc. I used/followed to end up there, but I kept a note of the commit for future reference. |
Actually, nevermind, it doesn't work... I found the relevant GH issue (a PR was never made): |
this obviously ties into #1982 |
https://docs.microsoft.com/en-us/windows/console/ Perhaps this will help. Specifically:
|
we've got the |
I assume Windows doesn't make use of POSIX signals (probably a good thing), so we'll need some replacement for
SIGWINCH
handling on that platform. @michaelsbradleyjr in #1953 refers to some event. thirty seconds of search suggests that the emulator receives aWM_SIZING
message through itsWindowProc
function, which @michaelsbradleyjr 's mention ofPeekConsoleInputW
kinda implies gets turned into an input on stdin (maybe not)?The text was updated successfully, but these errors were encountered: