diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 4ae0b868e7..8f620685a2 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -325,10 +325,11 @@ def self.move_cursor_down(val) def self.erase_after_cursor csbi = 0.chr * 24 @@GetConsoleScreenBufferInfo.call(@@hConsoleHandle, csbi) + attributes = csbi[8, 2].unpack1('S') cursor = csbi[4, 4].unpack1('L') written = 0.chr * 4 @@FillConsoleOutputCharacter.call(@@hConsoleHandle, 0x20, get_screen_size.last - cursor_pos.x, cursor, written) - @@FillConsoleOutputAttribute.call(@@hConsoleHandle, 0, get_screen_size.last - cursor_pos.x, cursor, written) + @@FillConsoleOutputAttribute.call(@@hConsoleHandle, attributes, get_screen_size.last - cursor_pos.x, cursor, written) end def self.scroll_down(val)