mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Treat key sequences from getwch() that start from 0 or 0xE0 correctly
This commit is contained in:
parent
58657fa134
commit
8c0629ba58
1 changed files with 6 additions and 0 deletions
|
@ -90,6 +90,12 @@ class Reline::Windows
|
||||||
end
|
end
|
||||||
until @@kbhit.call == 0
|
until @@kbhit.call == 0
|
||||||
ret = @@getwch.call
|
ret = @@getwch.call
|
||||||
|
if ret == 0 or ret == 0xE0
|
||||||
|
@@input_buf << ret
|
||||||
|
ret = @@getwch.call
|
||||||
|
@@input_buf << ret
|
||||||
|
return @@input_buf.shift
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
bytes = ret.chr(Encoding::UTF_8).encode(Encoding.default_external).bytes
|
bytes = ret.chr(Encoding::UTF_8).encode(Encoding.default_external).bytes
|
||||||
@@input_buf.push(*bytes)
|
@@input_buf.push(*bytes)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue