# IRB for mac

**URL:** <https://rubytalk.org/t/irb-for-mac/16848>\
**Category:** ruby-talk\
**Created:** [8 March 2005 21:17 UTC](https://rubytalk.org/t/irb-for-mac/16848 "2005-03-08T21:17:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Strandgaard2](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Simon\_Strandgaard2](https://rubytalk.org/u/Simon_Strandgaard2)\
**Post date:** [8 March 2005 21:17 UTC](https://rubytalk.org/t/irb-for-mac/16848/1 "2005-03-08T21:17:36Z")

</div>

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](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.

> **···**
>
> --  
> Simon Strandgaard

---

<div class="post-metadata">

**Author:** ![Dick\_Davies1](https://avatars.discourse-cdn.com/v4/letter/d/22d042/32.png) [@Dick\_Davies1](https://rubytalk.org/u/Dick_Davies1)\
**Post date:** [8 March 2005 21:23 UTC](https://rubytalk.org/t/irb-for-mac/16848/2 "2005-03-08T21:23:34Z")

</div>

\* Simon Strandgaard \<neoneye@gmail.com\> [0317 21:17]:

> 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.

> **···**
>
> --  
> 'I should have been a plumber.'  
> &nbsp;&nbsp;&nbsp;&nbsp;-- Albert Einstein  
> Rasputin :: Jack of All Trades - Master of Nuns

---

<div class="post-metadata">

**Author:** ![Curt\_Hibbs3](https://avatars.discourse-cdn.com/v4/letter/c/2acd7d/32.png) [@Curt\_Hibbs3](https://rubytalk.org/u/Curt_Hibbs3)\
**Post date:** [8 March 2005 21:24 UTC](https://rubytalk.org/t/irb-for-mac/16848/3 "2005-03-08T21:24:20Z")

</div>

Simon Strandgaard wrote:

> 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](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:

&nbsp;&nbsp;[http://rubyforge.org/projects/fxirb/](http://rubyforge.org/projects/fxirb/)

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

Curt

---

<div class="post-metadata">

**Author:** ![James\_Edward\_Gray\_II](https://avatars.discourse-cdn.com/v4/letter/j/ea5d25/32.png) [@James\_Edward\_Gray\_II](https://rubytalk.org/u/James_Edward_Gray_II)\
**Post date:** [8 March 2005 21:26 UTC](https://rubytalk.org/t/irb-for-mac/16848/4 "2005-03-08T21:26:23Z")

</div>

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

> **···**
>
> On Mar 8, 2005, at 3:17 PM, Simon Strandgaard wrote:
> 
> > 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?

---

<div class="post-metadata">

**Author:** ![Simon\_Strandgaard2](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Simon\_Strandgaard2](https://rubytalk.org/u/Simon_Strandgaard2)\
**Post date:** [8 March 2005 21:34 UTC](https://rubytalk.org/t/irb-for-mac/16848/5 "2005-03-08T21:34:50Z")

</div>

> 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](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:
> 
> &nbsp;&nbsp;[http://rubyforge.org/projects/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 ?

> **···**
>
> On Wed, 9 Mar 2005 06:24:20 +0900, Curt Hibbs \<curt@hibbs.com\> wrote:
> 
> --  
> Simon Strandgaard

---

<div class="post-metadata">

**Author:** ![Simon\_Strandgaard2](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@Simon\_Strandgaard2](https://rubytalk.org/u/Simon_Strandgaard2)\
**Post date:** [8 March 2005 21:42 UTC](https://rubytalk.org/t/irb-for-mac/16848/6 "2005-03-08T21:42:43Z")

</div>

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.

> **[WebMD - Better information. Better health.](https://www.webmd.com/?RubyOnMacintosh)**
>
> The leading source for trustworthy and timely health and medical news and information. Providing credible health information, supportive community, and educational services by blending award-winning expertise in content, community services, expert...

I will try it out.

> **···**
>
> On Wed, 9 Mar 2005 06:26:23 +0900, James Edward Gray II \<james@grayproductions.net\> wrote:
> 
> > On Mar 8, 2005, at 3:17 PM, Simon Strandgaard wrote:
> > 
> > \> 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.  
> > &nbsp;&nbsp;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.
> 
> --  
> Simon Strandgaard
