summaryrefslogtreecommitdiff
path: root/lib/reline/ansi.rb
diff options
context:
space:
mode:
authorTOMITA Masahiro <[email protected]>2021-09-26 15:39:45 +0900
committergit <[email protected]>2021-10-03 14:26:53 +0900
commitef350b3a5645a97270cbc72356eba671a1a41c20 (patch)
treea3c3d7ad0374e112e3a202688227a2b6ed7e07e8 /lib/reline/ansi.rb
parent2a3d0fbe172d52be9a64e0bd366c5f74177bd881 (diff)
[ruby/reline] Simplify SIGWINCH handler to avoid aborting when resizing.
https://github.com/ruby/reline/commit/481add0537
Diffstat (limited to 'lib/reline/ansi.rb')
-rw-r--r--lib/reline/ansi.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb
index f34d0b53fe..ae6961e29f 100644
--- a/lib/reline/ansi.rb
+++ b/lib/reline/ansi.rb
@@ -126,8 +126,8 @@ class Reline::ANSI
unless @@buf.empty?
return @@buf.shift
end
- until c = @@input.raw(intr: true, &:getbyte)
- sleep 0.1
+ until c = @@input.raw(intr: true) { select([@@input], [], [], 0.1) && @@input.getbyte }
+ Reline.core.line_editor.resize
end
(c == 0x16 && @@input.raw(min: 0, tim: 0, &:getbyte)) || c
rescue Errno::EIO