# Key-mapping

**URL:** <https://rubytalk.org/t/key-mapping/23492>\
**Category:** ruby-talk\
**Created:** [21 December 2005 14:22 UTC](https://rubytalk.org/t/key-mapping/23492 "2005-12-21T14:22:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://rubytalk.org/u/Gunnar)\
**Post date:** [21 December 2005 14:22 UTC](https://rubytalk.org/t/key-mapping/23492/1 "2005-12-21T14:22:50Z")

</div>

Hi all  
I know this is not a Ruby thing, but I try anyhow.  
When I'm using irb on my Linux system the cursor keypad works great, ie the leftarrow backspace and uparrow gives me the previous line.  
Using my iMac the keypad only results in an escape sequence (^[[A for uparrow, ^[[C for leftarrow etc). I have not been able to find any key-mapping in irb, or in the terminal setup.  
All help appreciated  
Gunnar

---

<div class="post-metadata">

**Author:** ![Ryan\_Leavengood](https://avatars.discourse-cdn.com/v4/letter/r/a587f6/32.png) [@Ryan\_Leavengood](https://rubytalk.org/u/Ryan_Leavengood)\
**Post date:** [21 December 2005 20:13 UTC](https://rubytalk.org/t/key-mapping/23492/2 "2005-12-21T20:13:47Z")

</div>

That functionality is provided by the readline library, which I don't  
think is setup with Ruby by default on Mac OS X (or maybe it is but  
you just need to enable that option on irb.) But either way the Ruby  
provided with Mac OS X is broken in various ways. Here is information  
on how to properly set up Ruby on a Mac:

> **[Dan Benjamin](https://danbenjamin.com)**
>
> Dan Benjamin's personal website.

Ryan

> **···**
>
> On 12/21/05, Gunnar \<gunnar.larsson2@comhem.se\> wrote:
> 
> > Hi all  
> > I know this is not a Ruby thing, but I try anyhow.  
> > When I'm using irb on my Linux system the cursor keypad works great, ie  
> > the leftarrow backspace and uparrow gives me the previous line.  
> > Using my iMac the keypad only results in an escape sequence (^[[A for  
> > uparrow, ^[[C for leftarrow etc). I have not been able to find any  
> > key-mapping in irb, or in the terminal setup.  
> > All help appreciated  
> > Gunnar

---

<div class="post-metadata">

**Author:** ![Gunnar](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@Gunnar](https://rubytalk.org/u/Gunnar)\
**Post date:** [21 December 2005 21:17 UTC](https://rubytalk.org/t/key-mapping/23492/3 "2005-12-21T21:17:48Z")

</div>

Ryan  
Thank you very much.  
Went to article, did what it said -\>everything works great.  
Best regards  
Gunnar  
Ryan Leavengood wrote:

> **···**
>
> > That functionality is provided by the readline library, which I don't  
> > think is setup with Ruby by default on Mac OS X (or maybe it is but  
> > you just need to enable that option on irb.) But either way the Ruby  
> > provided with Mac OS X is broken in various ways. Here is information  
> > on how to properly set up Ruby on a Mac:
> > 
> > [Dan Benjamin](http://hivelogic.com/articles/2005/12/01/ruby_rails_lighttpd_mysql_tiger)
> > 
> > Ryan
> > 
> > On 12/21/05, Gunnar \<gunnar.larsson2@comhem.se\> wrote:
> > 
> > > Hi all  
> > > I know this is not a Ruby thing, but I try anyhow.  
> > > When I'm using irb on my Linux system the cursor keypad works great, ie  
> > > the leftarrow backspace and uparrow gives me the previous line.  
> > > Using my iMac the keypad only results in an escape sequence (^[[A for  
> > > uparrow, ^[[C for leftarrow etc). I have not been able to find any  
> > > key-mapping in irb, or in the terminal setup.  
> > > All help appreciated  
> > > Gunnar
