зеркало из https://github.com/github/ruby.git
[ruby/irb] Always use alternate sceen on alt-d
(https://github.com/ruby/irb/pull/988) https://github.com/ruby/irb/commit/db0a923d62
This commit is contained in:
Родитель
fbabe13b7e
Коммит
09ddfd4d1c
|
@ -125,7 +125,6 @@ module IRB
|
|||
canvas = Canvas.new(Reline.get_screen_size)
|
||||
end
|
||||
ruby_model = RubyModel.new
|
||||
print "\e[?1049h"
|
||||
0.step do |i| # TODO (0..).each needs Ruby 2.6 or later
|
||||
buff = canvas.draw do
|
||||
ruby_model.render_frame(i) do |p1, p2|
|
||||
|
|
|
@ -348,9 +348,15 @@ module IRB
|
|||
if show_easter_egg
|
||||
IRB.__send__(:easter_egg)
|
||||
else
|
||||
# RDoc::RI::Driver#display_names uses pager command internally.
|
||||
# Some pager command like `more` doesn't use alternate screen
|
||||
# so we need to turn on and off alternate screen manually.
|
||||
begin
|
||||
print "\e[?1049h"
|
||||
driver.display_names([name])
|
||||
rescue RDoc::RI::Driver::NotFoundError
|
||||
ensure
|
||||
print "\e[?1049l"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Загрузка…
Ссылка в новой задаче