mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
Defuse time bomb on EditLine Readline wrapper
If you are using the basic OS X Readline impl, and you Pry.auto_resize!, you'll find that their Readline.set_screen_size = ___ segfaults. Instead of letting this happen, we'll tell the user about it and point them to the fix (of using GNU Readline).
This commit is contained in:
parent
b33fa0ab69
commit
b3a74e5809
1 changed files with 9 additions and 0 deletions
|
@ -247,6 +247,15 @@ class Pry
|
|||
end
|
||||
|
||||
def self.auto_resize!
|
||||
ver = Readline::VERSION
|
||||
if ver[/edit/i]
|
||||
warn <<-EOT
|
||||
Readline version #{ver} 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!
|
||||
|
|
Loading…
Add table
Reference in a new issue