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|
|
@@input.raw do |stdin|
|
||||||
@@output << "\e[6n"
|
@@output << "\e[6n"
|
||||||
@@output.flush
|
@@output.flush
|
||||||
while (c = stdin.getc) != 'R'
|
while (c = stdin.getc)
|
||||||
res << c if c
|
res << c
|
||||||
|
m = res.match(/\e\[(?<row>\d+);(?<column>\d+)R/)
|
||||||
|
break if m
|
||||||
end
|
end
|
||||||
m = res.match(/\e\[(?<row>\d+);(?<column>\d+)/)
|
|
||||||
(m.pre_match + m.post_match).chars.reverse_each do |ch|
|
(m.pre_match + m.post_match).chars.reverse_each do |ch|
|
||||||
stdin.ungetc ch
|
stdin.ungetc ch
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue