Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.5: Fix Control-R in the Ruby interactive shell UNIX
It appears that Leopard ships with popular UNIX tools linked against a new BSD-licensed libedit library instead of more popular readline (which was the case in Tiger). This may cause few surprises if you are a hardcore shell prompt surfer.

I was especially irritated by Control-R (reverse history search) not working in irb (ruby interactive shell), which was using the new libedit library. The solution to this particular deficiency is very simple -- just configure libedit by editing a file named .editrc in your home directory. Add this line:
bind "^R" em-inc-search-prev
You can also set many different options in that file -- for more help, run man editrc.
    •    
  • Currently 2.64 / 5
  You rated: 5 / 5 (11 votes cast)
 
[10,896 views]  

10.5: Fix Control-R in the Ruby interactive shell | 3 comments | Create New Account
Click here to return to the '10.5: Fix Control-R in the Ruby interactive shell' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Fix Control-R in the Ruby interactive shell
Authored by: spacechurro on Mar 20, '08 07:34:38PM

I also added the ability to jump between words using ctrl + left and ctrl + right using the following:

bind "^[O5C" vi-next-word
bind "^[O5D" vi-prev-word



[ Reply to This | # ]
10.5: Fix Control-R in the Ruby interactive shell
Authored by: yanowitz on Mar 24, '08 06:00:52AM

thank you!

this has been driving me nuts but I hadn't had the time to investigate.

what a relief.



[ Reply to This | # ]
10.5: Fix Control-R in the Ruby interactive shell
Authored by: edan on Aug 05, '08 08:55:18AM

for tab completion to work i had to do:

bind ^I rl_complete



[ Reply to This | # ]