From: Ken Bloom Date: 2006-09-16T06:45:55+09:00 Subject: Re: readline() with editing and history? On Sat, 16 Sep 2006 02:41:17 +0900, Josef Wolf wrote: > On Sat, Sep 16, 2006 at 01:58:27AM +0900, Kent Sibilev wrote: >> On 9/15/06, Josef Wolf wrote: >> >I'm looking for a readline() with history and editing support (like perl's >> >Term::Readline). Does such a thing exist for ruby? >> > >> require 'readline' >> >> It comes with Ruby. > > Thanks for your quick reply, Kent! But somehow I don't get it: > > jw@raven> irb > irb(main):001:0> require 'readline' > => false > irb(main):002:0> readline > asdf^[[D^[[D^[[A^[[A > => "asdf\e[D\e[D\e[A\e[A\n" > > The ^[[D is the result of the up-arrow and ^[[A is the result of the > left-arrow. "ri readline" mentiones: > > IO::readlines, IO#readline, IO#readlines, Kernel#readlines, > Kernel#readline, Pathname#readlines, Zlib::GzipReader#readline, > Zlib::GzipReader#readlines > > But none of them seem to support line-editing or history. :-( > > Any idea what is going wrong here? you need to include the Readline module that is contained within the 'readline' file. So the instructions should actually have been require 'readline' include Readline -- Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/