diff --git a/lib/irb/pager.rb b/lib/irb/pager.rb index d50348786..3391b32c6 100644 --- a/lib/irb/pager.rb +++ b/lib/irb/pager.rb @@ -41,7 +41,7 @@ def page(retain_content: false) private def should_page? - IRB.conf[:USE_PAGER] && STDIN.tty? && ENV["TERM"] != "dumb" + IRB.conf[:USE_PAGER] && STDIN.tty? && (ENV.key?("TERM") && ENV["TERM"] != "dumb") end def content_exceeds_screen_height?(content)