diff --git a/lib/pry/pry_class.rb b/lib/pry/pry_class.rb index 7065effa..cf284b89 100644 --- a/lib/pry/pry_class.rb +++ b/lib/pry/pry_class.rb @@ -233,15 +233,22 @@ class Pry end def self.auto_resize! - ver = Readline::VERSION - if ver[/edit/i] + Pry.config.input # by default, load Readline + + if !defined?(Readline) || Pry.config.input != Readline + warn "Sorry, you must be using Readline for Pry.auto_resize! to work." + return + end + + if Readline::VERSION =~ /edit/i warn <<-EOT -Readline version #{ver} detected - will not auto_resize! correctly. +Readline version #{Readline::VERSION} detected - will not auto_resize! correctly. For the fix, use GNU Readline instead: https://github.com/guard/guard/wiki/Add-proper-Readline-support-to-Ruby-on-Mac-OS-X EOT return end + trap :WINCH do begin Readline.set_screen_size(*Terminal.size!)