summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-09-08 13:34:01 (GMT)
committeraycabta <aycabta@gmail.com>2019-09-09 15:56:31 (GMT)
commit6d9e54816f828983bcf383ce6fce287bd3ca05b9 (patch)
tree4089e49b953092a9693a61f54cc5b3b147b69bce
parent685f12bbca50ff9b7a16b3016b3b8b3f2ac8b796 (diff)
Support multibyte input
-rw-r--r--lib/reline/ansi.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb
index 2eca2b0..92d4522 100644
--- a/lib/reline/ansi.rb
+++ b/lib/reline/ansi.rb
@@ -26,7 +26,8 @@ class Reline::ANSI
unless @@buf.empty?
return @@buf.shift
end
- @@input.raw(&:getbyte)
+ c = @@input.raw(&:getbyte)
+ (c == 0x16 && @@input.raw(min: 0, tim: 0, &:getbyte)) || c
end
def self.ungetc(c)