From 8c0629ba58c5c95b970a657493d261356eedea1d Mon Sep 17 00:00:00 2001 From: aycabta Date: Fri, 18 Oct 2019 02:51:12 +0900 Subject: Treat key sequences from getwch() that start from 0 or 0xE0 correctly --- lib/reline/windows.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/reline/windows.rb b/lib/reline/windows.rb index efde9d1b38..477152e436 100644 --- a/lib/reline/windows.rb +++ b/lib/reline/windows.rb @@ -90,6 +90,12 @@ class Reline::Windows end until @@kbhit.call == 0 ret = @@getwch.call + if ret == 0 or ret == 0xE0 + @@input_buf << ret + ret = @@getwch.call + @@input_buf << ret + return @@input_buf.shift + end begin bytes = ret.chr(Encoding::UTF_8).encode(Encoding.default_external).bytes @@input_buf.push(*bytes) -- cgit v1.2.3