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 Aug 14, 2024
1 parent ab394db commit 09d89af
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/irb/input-method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ def show_doc_dialog_proc
driver = input_method.rdoc_ri_driver

if key.match?(dialog.name)
# easter_egg and RDoc::RI::Driver#display_names use pager internally.
# Some pager command like `more` doesn't use alternate screen
# so we need to turn on and off alternate screen manually.
print "\e[?1049h"
if show_easter_egg
IRB.__send__(:easter_egg)
else
Expand All @@ -360,6 +364,7 @@ def show_doc_dialog_proc
rescue RDoc::RI::Driver::NotFoundError
end
end
print "\e[?1049l"
end

begin
Expand Down

0 comments on commit 09d89af

Please sign in to comment.