From b74dd665c0e9558f355cbe1a625beb444c2a2ab4 Mon Sep 17 00:00:00 2001 From: aycabta Date: Thu, 29 Aug 2019 20:59:29 +0900 Subject: CONSOLE_SCREEN_BUFFER_INFO is 22bytes typedef struct _CONSOLE_SCREEN_BUFFER_INFO { COORD dwSize; // 4(SHORT X, Y) COORD dwCursorPosition; // 4 WORD wAttributes; // 2 SMALL_RECT srWindow; // 8(SHORT Left, Top, Right, Bottom) COORD dwMaximumWindowSize; // 4 } CONSOLE_SCREEN_BUFFER_INFO; --- lib/reline/windows.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 6b80f6ca2d..0bd8d1b147 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -122,13 +122,13 @@ class Reline::Windows end def self.get_screen_size - csbi = 0.chr * 24 + csbi = 0.chr * 22 @@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi) csbi[0, 4].unpack('SS').reverse end def self.cursor_pos - csbi = 0.chr * 24 + csbi = 0.chr * 22 @@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi) x = csbi[4, 2].unpack('s*').first y = csbi[6, 4].unpack('s*').first -- cgit v1.2.1