tty(windows): fix resize event screen size translation from srWindow

This commit is contained in:
CJ van den Berg 2024-06-27 21:39:49 +02:00 committed by Tim Culverhouse
parent b84f9e58a6
commit c213919849

View file

@ -379,8 +379,8 @@ pub fn nextEvent(self: *Tty) !Event {
return windows.unexpectedError(windows.kernel32.GetLastError()); return windows.unexpectedError(windows.kernel32.GetLastError());
} }
const window_rect = console_info.srWindow; const window_rect = console_info.srWindow;
const width = window_rect.Right - window_rect.Left; const width = window_rect.Right - window_rect.Left + 1;
const height = window_rect.Bottom - window_rect.Top; const height = window_rect.Bottom - window_rect.Top + 1;
return .{ return .{
.winsize = .{ .winsize = .{
.cols = @intCast(width), .cols = @intCast(width),