diff options
author | aycabta <aycabta@gmail.com> | 2021-08-20 23:14:42 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2021-08-29 20:30:32 +0900 |
commit | d7f654ad5a688dfcd6c274346c437e36ce249c4f (patch) | |
tree | c345a9002843a3ee00c4ab8dc4fe50e04cf354af /lib | |
parent | 6f66927aefd50f9df9ce7d935688dcd0f45e9b4e (diff) | |
download | ruby-d7f654ad5a688dfcd6c274346c437e36ce249c4f.tar.gz |
[ruby/reline] Add "sleep 0.01" to Windows event loop
https://github.com/ruby/reline/commit/dfc89eae53
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/windows.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index 5b4cb05b99..520ac59e16 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -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 |