1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/reline] follow consolemode change

fix 'https://github.com/ruby/reline/issues/300'

https://github.com/ruby/reline/commit/b2cc6805a8
This commit is contained in:
YO4 2021-12-07 20:45:58 +09:00 committed by git
parent eb2d3c19fe
commit 66e14e2076

View file

@ -235,7 +235,11 @@ class Reline::Windows
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