aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2021-08-20 23:14:42 +0900
committeraycabta <aycabta@gmail.com>2021-08-29 20:30:32 +0900
commitd7f654ad5a688dfcd6c274346c437e36ce249c4f (patch)
treec345a9002843a3ee00c4ab8dc4fe50e04cf354af /lib
parent6f66927aefd50f9df9ce7d935688dcd0f45e9b4e (diff)
downloadruby-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.rb1
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