aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline/windows.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-08-29 20:59:29 +0900
committeraycabta <aycabta@gmail.com>2019-08-29 21:03:44 +0900
commitb74dd665c0e9558f355cbe1a625beb444c2a2ab4 (patch)
tree2abd4d8653763e43211194ea0502bf73343875e5 /lib/reline/windows.rb
parenta4a19b114ba94b8f28d5a91aee5d595a516006d5 (diff)
downloadruby-b74dd665c0e9558f355cbe1a625beb444c2a2ab4.tar.gz
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;
Diffstat (limited to 'lib/reline/windows.rb')
-rw-r--r--lib/reline/windows.rb4
1 files changed, 2 insertions, 2 deletions
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