IRB for mac

  • Thread starter Simon Strandgaard
  • Start date
S

Simon Strandgaard

In the terminal there seems to be problem with the arrow keys.
When pressing arrow_left then I see ^[[D in the terminal.
pressing CTRL-A doesn't work neither.
I suspect the escape sequences isn't being read correct.

What is the solution for this?


btw: I am learning about Cocoa on mac and figured it would be
interesting to write a GUI frontend for IRB. Something like this:
http://aeditor.rubyforge.org/data/mac_irb1.png

I wonder how I can establish communication with irb.
I am in paticular curious to how/if the freeride team has done it.
 
D

Dick Davies

* Simon Strandgaard said:
In the terminal there seems to be problem with the arrow keys.
When pressing arrow_left then I see ^[[D in the terminal.
pressing CTRL-A doesn't work neither.
I suspect the escape sequences isn't being read correct.

What is the solution for this?

Install the readline extension - see list archives.
 
C

Curt Hibbs

Simon said:
In the terminal there seems to be problem with the arrow keys.
When pressing arrow_left then I see ^[[D in the terminal.
pressing CTRL-A doesn't work neither.
I suspect the escape sequences isn't being read correct.

What is the solution for this?


btw: I am learning about Cocoa on mac and figured it would be
interesting to write a GUI frontend for IRB. Something like this:
http://aeditor.rubyforge.org/data/mac_irb1.png

I wonder how I can establish communication with irb.
I am in paticular curious to how/if the freeride team has done it.

In FreeRIDE, we are using Martin DeMello's FXIrb:

http://rubyforge.org/projects/fxirb/

You could take a look and see what he is doing.

Curt
 
J

James Edward Gray II

In the terminal there seems to be problem with the arrow keys.
When pressing arrow_left then I see ^[[D in the terminal.
pressing CTRL-A doesn't work neither.
I suspect the escape sequences isn't being read correct.

What is the solution for this?

I suspect Ruby did not link against the readline library when
installing. I always install GNU Readline on OX X before I build Ruby.
I can use the arrow keys in irb normally, but my .irbrc file contains:

require 'irb/completion'
ARGV.concat [ "--readline" ]

Might try "irb --readline".

I'm completely guessing here and way out of my area though, so maybe on
of the gurus will have better advice...

Good luck.

James Edward Gray II
 
S

Simon Strandgaard

Simon Strandgaard wrote: [snip]
btw: I am learning about Cocoa on mac and figured it would be
interesting to write a GUI frontend for IRB. Something like this:
http://aeditor.rubyforge.org/data/mac_irb1.png

I wonder how I can establish communication with irb.
I am in paticular curious to how/if the freeride team has done it.

In FreeRIDE, we are using Martin DeMello's FXIrb:

http://rubyforge.org/projects/fxirb/

You could take a look and see what he is doing.

I wasn't aware of FXIrb, nice. Thanks.


I am wondering how to make my Cocoa project into a ruby-extension,
so that I can require it from Ruby (so that main is in Ruby).
Any ideas on this ?
 
S

Simon Strandgaard

In the terminal there seems to be problem with the arrow keys.
When pressing arrow_left then I see ^[[D in the terminal.
pressing CTRL-A doesn't work neither.
I suspect the escape sequences isn't being read correct.

What is the solution for this?

I suspect Ruby did not link against the readline library when
installing. I always install GNU Readline on OX X before I build Ruby.
I can use the arrow keys in irb normally, but my .irbrc file contains:

require 'irb/completion'
ARGV.concat [ "--readline" ]

Might try "irb --readline".

I'm completely guessing here and way out of my area though, so maybe on
of the gurus will have better advice...

Good luck.

Thanks, I should have known that a week ago :)


I just realized that there exists a binary installer for ruby 1.8.2, that has
readline with it. The reason why I overlooked it the first time, was
because I didn't knew what a .dmg file was.

http://www.rubygarden.org/ruby?RubyOnMacintosh

I will try it out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top