Irb without history?

Hello NG,

this is my first posting
I was playing a little with ruby and irb today
what is a little annoying is reentering commands
on the interpreter (irb)
I know and use often Python interactive interpreter
for some quick calculations
Is there a way to let irb remember the entered commands
like in Python?

irb -v
irb 0.9(02/07/03)

is it out if date?

thx for help and advice

Daniel

Take a look at:
http://www.rubygarden.org/ruby?Irb/TipsAndTricks

well, I dont want to maintain history through the sessions
sorry if I was unclear about it

irb(main):001:0> i=0
=> 0
irb(main):002:0>
irb(main):003:0* ^[[A

I get ^[[A when I press ArrowUp key
I would like "i" to show up instead

strace -e open irb
tells me that at least irb opens ~/.irbrc file

thx in advance

Daniel Schüle wrote:

well, I dont want to maintain history through the sessions
sorry if I was unclear about it

irb(main):001:0> i=0
=> 0
irb(main):002:0>
irb(main):003:0* ^[[A

I get ^[[A when I press ArrowUp key
I would like "i" to show up instead

Looks like a readline problem. What OS/Ruby version are you using?
(try: ruby -v).
If this is indeed a readline problem, you may need to enable readline
and recompile (assuming you're on *nix). It's been a while for me, so
maybe someone else here can help more.

HTH,
Assaph

Daniel Schüle wrote:

well, I dont want to maintain history through the sessions
sorry if I was unclear about it

irb(main):001:0> i=0
=> 0
irb(main):002:0>
irb(main):003:0* ^[[A

I get ^[[A when I press ArrowUp key
I would like "i" to show up instead

That looks like Ruby didn't get properly linked with Readline when it
was built.

Looks like a readline problem. What OS/Ruby version are you using?
(try: ruby -v).

mond:~ # ruby -v
ruby 1.8.0 (2003-08-04) [i686-linux]
mond:~ # irb -v
irb 0.9(02/07/03)
mond:~ #

mond:~ # uname
Linux
mond:~ # uname -r
2.4.21-99-default

SuSE 9.0

If this is indeed a readline problem, you may need to enable readline
and recompile (assuming you're on *nix). It's been a while for me, so
maybe someone else here can help more.

I will try to get the source and recompile

Fair warning: Silly question here.

Have you tried launching irb with the --readline switch?

James Edward Gray II

···

On Jun 20, 2005, at 8:10 AM, Daniel Schüle wrote:

If this is indeed a readline problem, you may need to enable readline
and recompile (assuming you're on *nix). It's been a while for me, so
maybe someone else here can help more.

I will try to get the source and recompile

James Edward Gray II wrote:

If this is indeed a readline problem, you may need to enable readline
and recompile (assuming you're on *nix). It's been a while for me, so
maybe someone else here can help more.

I will try to get the source and recompile

now I tried but unfortunately the problem remains
../configure --help
seems to have no option where I could "--enable-readline"

Fair warning: Silly question here.

Have you tried launching irb with the --readline switch?

no, I didn't

mond:/pool/installed/ruby/ruby1/bin # ./irb --readline
irb(main):001:0> i=0
=> 0
irb(main):002:0> ^[[A

seems not to work :-/

I am not a Linux expert and cannot tell for sure whether this
is ruby or OS related problem
Is there somebody who didn't have this problem on Linux,
especially SuSE distro?

···

On Jun 20, 2005, at 8:10 AM, Daniel Schüle wrote: