I have been encountering an error because cols is set to zero when the division occurs. Please get in touch if you would like me to make any corrections. Thanks!
prevent ZeroDivisionError when cols == 0
Looks related to #557.
Thanks, this needs fixing :).
@sonnym Just before we pull this into pry, do you know how cols is getting == 0? It might be that we need to change the order of the methods we try to calculate it.
Looks like Readline.get_screen_size is returning zero for me.
Thanks again! I've updated the code to try reading ENV["COLUMNS"] if that happens — and also kept your safeguard in there to prevent errors in future :).
Excellent. Thanks for the quick response and pulling my fork! Now I can't wait for the next version bump, heh.
On MRI 1.8.7-p358, this results in "TypeError: String can't be coerced into Fixnum", as cols is a string.
This appears to fix it:
cols = cols.to_i rescue cols
(I'm afraid I can't isolate it any further right now.)
@FND This has been fixed in b2facc3
@YorickPeterse: I know, @banister and I discussed it on IRC - thanks for letting me know though!
version 0.9.9.6 release
As a result of the 0.9.9.5 fix for #558 we got the following
error on 1.8.7:
"On MRI 1.8.7-p358, this results in "TypeError:
String can't be coerced into Fixnum",".
This commit should fix that.