From f845cea5160d7ab60aa7a582f873340078f967fd Mon Sep 17 00:00:00 2001 From: Nathan <89677116+generic-user1@users.noreply.github.com> Date: Sun, 9 Oct 2022 14:08:17 -0400 Subject: [PATCH] Make Windows resize event match `terminal::size` (#714) --- src/event/source/windows.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/event/source/windows.rs b/src/event/source/windows.rs index 752f75347..32deb7929 100644 --- a/src/event/source/windows.rs +++ b/src/event/source/windows.rs @@ -64,7 +64,11 @@ impl EventSource for WindowsEventSource { mouse_event } InputRecord::WindowBufferSizeEvent(record) => { - Some(Event::Resize(record.size.x as u16, record.size.y as u16)) + // windows starts counting at 0, unix at 1, add one to replicate unix behaviour. + Some(Event::Resize( + record.size.x as u16 + 1, + record.size.y as u16 + 1, + )) } InputRecord::FocusEvent(record) => { let event = if record.set_focus {