[前][次][番号順一覧][スレッド一覧]

ruby-changes:68231

From: aycabta <ko1@a...>
Date: Mon, 4 Oct 2021 00:14:22 +0900 (JST)
Subject: [ruby-changes:68231] 1e9714cf34 (master): [ruby/reline] Use default background color to erase on Windows

https://git.ruby-lang.org/ruby.git/commit/?id=1e9714cf34

From 1e9714cf34234d7af93814a398ff858377c2c0f3 Mon Sep 17 00:00:00 2001
From: aycabta <aycabta@g...>
Date: Sun, 3 Oct 2021 23:02:24 +0900
Subject: [ruby/reline] Use default background color to erase on Windows

https://github.com/ruby/reline/commit/852e855d82
---
 lib/reline/windows.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 @@ class Reline::Windows https://github.com/ruby/ruby/blob/trunk/lib/reline/windows.rb#L325
   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)
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]