While using irbtools, irb will not producing a new line after hitting the return key after a new statement
AKST opened this issue · 3 comments
I've done a quite a bit of googling and I can't seem to find anything about this. I'm not completely sure if this is a feature or not but it's driving me insane.
>> str = "(123) 456-7890" #=> "(123) 456-7890">>
I'm assuming it's a bug, and the output of the statement should appear on a new line, along with the start of the next statement. It's also doing weird things like the text cursor is overlapping input, after i finish another statement.
Before I hit the return key
>> str = "(123) 456-7890" #=> "(123) 456-7890">> re = /\(\d{3}\) \d{3}-\d{4}/
After I hit the return key
>> str = "(123) 456-7890" #=> "(#=> /\(\d{3}\) \d{3}-\d{4}/>> \) \d{3}-\d{4}/
That certainly does not look like a feature to me. It will continue to do this unless I hit the return key after the statement output has been returned.
>> str = "(123) 456-7890" #=> "(#=> /\(\d{3}\) \d{3}-\d{4}/>> \) \d{3}-\d{4}/
>
When the new line appears my text cursor is indented, and it appears to be missing one of the arrows indicating it's a new line is there. This is what my .irbrc looks like at the moment. All I've got is irbtools & interactive-editor.
require 'interactive_editor'
require 'irbtools'
I've tried irb without irbtools and I don't get any this behaviour.
edit: additional detail
Hi AKST,
thank you for your bug report!
Can you please provide the following information:
- On which OS are you?
- Which terminal emulator do you use?
- Which shell do you use? (echo $SHELL)
- Which Ruby version do you use?
Does it also happen, when you do the following steps:
$ irb -f
>> require 'fancy_irb'
>> FancyIrb.start
str = "(123) 456-7890"
- I'm using OS X Mountain Lion
- The Default terminal on OS X
- echo $SHELL returns '/bin/bash'
- ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin12.2.0]
Here's the output of the text
$ irb -f
irb(main):001:0> require 'fancy_irb'
=> true
irb(main):002:0> FancyIrb.start
=> true
irb(main):003:0> str = "(123) 456-7890" #=> "(123) 456-7890"irb(main):004:0>
Can you please clone https://github.com/janlelis/fancy_irb.git and in lib/fancy_irb/irb_ext.rb
change in line 70 TPUT[:rc]
to TPUT[:rc] + "\n"
Then run rake install
and check, if you still get the error.
Please open a new issue in https://github.com/janlelis/fancy_irb and post the result (or any questions) there.
Thank you very much!