ruby-changes:70146
From: YO4 <ko1@a...>
Date: Fri, 10 Dec 2021 22:16:18 +0900 (JST)
Subject: [ruby-changes:70146] 66e14e2076 (master): [ruby/reline] follow consolemode change
https://git.ruby-lang.org/ruby.git/commit/?id=66e14e2076 From 66e14e2076ce08c5425b3000a164a5c62a10b106 Mon Sep 17 00:00:00 2001 From: YO4 <ysno@a...> Date: Tue, 7 Dec 2021 20:45:58 +0900 Subject: [ruby/reline] follow consolemode change fix 'https://github.com/ruby/reline/issues/300' https://github.com/ruby/reline/commit/b2cc6805a8 --- lib/reline/windows.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 73653b2de2c..08ab3f26101 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -235,7 +235,11 @@ class Reline::Windows https://github.com/ruby/ruby/blob/trunk/lib/reline/windows.rb#L235 num_of_events = 0.chr * 8 while @@output_buf.empty? Reline.core.line_editor.resize - next if @@WaitForSingleObject.(@@hConsoleInputHandle, 100) != 0 # max 0.1 sec + if @@WaitForSingleObject.(@@hConsoleInputHandle, 100) != 0 # max 0.1 sec + # prevent for background consolemode change + @@legacy_console = (getconsolemode() & ENABLE_VIRTUAL_TERMINAL_PROCESSING == 0) + next + end next if @@GetNumberOfConsoleInputEvents.(@@hConsoleInputHandle, num_of_events) == 0 or num_of_events.unpack1('L') == 0 input_record = 0.chr * 18 read_event = 0.chr * 4 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/