mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
8882927036
commit
cdd7d41046
1 changed files with 4 additions and 3 deletions
|
@ -112,10 +112,11 @@ class Reline::ANSI
|
|||
@@input.raw do |stdin|
|
||||
@@output << "\e[6n"
|
||||
@@output.flush
|
||||
while (c = stdin.getc) != 'R'
|
||||
res << c if c
|
||||
while (c = stdin.getc)
|
||||
res << c
|
||||
m = res.match(/\e\[(?<row>\d+);(?<column>\d+)R/)
|
||||
break if m
|
||||
end
|
||||
m = res.match(/\e\[(?<row>\d+);(?<column>\d+)/)
|
||||
(m.pre_match + m.post_match).chars.reverse_each do |ch|
|
||||
stdin.ungetc ch
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue