Bug #9204

Issues when compiled with libedit instead of readline

Added by noniq (Stefan Daschek) almost 4 years ago. Updated almost 3 years ago.

Third Party's Issue
Target version:
ruby -v:
ruby 2.1.0dev (2013-11-23 trunk 43807) [x86_64-darwin13.0


Compiling Ruby on Mac OS X uses BSD libedit instead of GNU readline, leading to various problems. Most notably: With libedit it’s not possible to input accented characters (e.g. ÄÖÜ) in irb or pry:

$ irb # Ruby 2.1.0-preview2
irb(main):001:0> "a \U+FFC3\U+FFA4" # typing 'a ä' results in this weird escape sequence
=> "a "

This issue has already been mentioned on ruby-core in 2009, but with no apparent result:

This shows up quite often, usually it’s suggested to manually install GNU readline before compiling Ruby (and making sure readline is actually found and used when configuring / compiling):

Maybe Ruby could bundle readline to avoid this kind of issues?


#1 [ruby-core:58834] Updated by nobu (Nobuyoshi Nakada) almost 4 years ago

  • Status changed from Open to Third Party's Issue

It's your choice.

#2 [ruby-core:58857] Updated by noniq (Stefan Daschek) almost 4 years ago

Indeed, but unfortunately it’s a badly documented choice with rather surprising consequences: Compiling Ruby works seemingly without any problems, and you may use Ruby for several days or even months before noticing the issue. And then it’s quite hard to find out that this has something todo with the way you initially compiled Ruby.

Could there at least be a big warning when compiling with libedit, saying something like “Warning: This build uses libedit instead of readline. You will not be able to use accented characters in irb.“? Dave Thomas already suggested this back in 2009:

#3 [ruby-core:67642] Updated by bapt (Baptiste Daroussin) almost 3 years ago

Please note that on FreeBSD I managed to fix the issue

Basically I added to the latest libedit a couple of patches:

I have also had to remove the following line from the ext/readline/extconf.rb in ruby:

The env should be set to support UTF-8

Also available in: Atom PDF