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

[ruby/reline] Add "sleep 0.01" to Windows event loop

https://github.com/ruby/reline/commit/dfc89eae53
This commit is contained in:
aycabta 2021-08-20 23:14:42 +09:00
parent 6f66927aef
commit d7f654ad5a

View file

@ -218,6 +218,7 @@ class Reline::Windows
def self.check_input_event
num_of_events = 0.chr * 8
while @@output_buf.empty? #or true
sleep 0.01
next if @@GetNumberOfConsoleInputEvents.(@@hConsoleInputHandle, num_of_events) == 0 or num_of_events.unpack('L').first == 0
input_record = 0.chr * 18
read_event = 0.chr * 4