When I enter a string that is too long for the console width into a pry or regular irb console it wraps as usual, see below (Using pry in OS X 10.8.2 terminal.app):
However when I try to replay the command using the up arrow I get this: Pry cuts off some of the command and repeats the prompt. Irb on the other hand behaves just fine, even scrolling up the buffer if needed:
Kyrylo: We have that fixed in the master branch if you Pry.auto_resize!
But the problem here is (as ryanf points out on Freenode #pry), is that the prompt has color escapes in it.
\e[XXn
takes up no spaces, but counts as 5 bytes, so Readline gets confused.
Does anyone know of any Ruby use of Readline that doesn't have this problem?
It looks like you resized your terminal window after you entered the first expression. For the time being, Pry doesn't really take into account this event and treats window size as a constant value. Unfortunately, the only solution is to relaunch Pry every time you need to resize your window. This is a bug and sooner or later it will be fixed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With