Skip to content

Commit

Permalink
Merge pull request #366 from aycabta/use-default-bgcolor-to-erase
Browse files Browse the repository at this point in the history
Use default background color to erase on Windows
  • Loading branch information
aycabta committed Oct 3, 2021
2 parents b563fc3 + 852e855 commit 52b7e20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/reline/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 52b7e20

Please sign in to comment.