I discussed this at length last week with Brian Marick.

He claims that you should be able to do ctrl-c in IRB and have it reset, without losing history etc. This would be useful if you get in a situation where you have unmatched quotes and parens and the like. He gets this all the time on his Mac and has seen it work right on Windows too.

The problem is the windows batch script intercepts the ctrl-c before IRB can get it.

The solution is to directly start irb without using the batch file. Thus:

C:\>ruby c:\ruby\bin\irb
irb(main):001:0> lets mess things up("
irb(main):002:1" a
irb(main):003:1" why isn't irb working?
irb(main):004:1" ^C
irb(main):004:0> puts 'now it is fixed'
now it is fixed
=> nil


At 07:35 AM 7/30/2005, Chris Morris wrote:
Tuyet Cong-Ton-Nu wrote:

I don't know how to get back to irb when it gives me this message:

Terminate batch job Y/N?

It doesn't matter if I say Y or N, it terminates irb and sends me back to the command prompt which is not what I want when

I select N.
The "terminate batch job Y/N" is not a part of irb itself, that's a Windows thing. I believe the Windows installer for Ruby (which is not part of the official Ruby release, but a separate project) creates this batch file to make launching irb a simpler thing to do. The underlying problem in your case is figuring out why irb is terminating suddenly. Once you get the prompt to terminate the batch job or not, irb is already lost, which is why answering N does no good. If you can figure out what sort of steps lead to this behavior and post them here or to the Ruby list, maybe you can get some better assistance.

--
Chris
http://clabs.org/blogki

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_____________________
 Bret Pettichord
 www.pettichord.com

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to