Skip to content

Commit

Permalink
Always use alternate sceen on alt-d
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng committed Sep 3, 2024
1 parent 30fa159 commit 966c490
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/irb/easter-egg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def render_frame(i)
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|
Expand Down
6 changes: 6 additions & 0 deletions lib/irb/input-method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,15 @@ def show_doc_dialog_proc
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
Expand Down

0 comments on commit 966c490

Please sign in to comment.