irb without history?

D

Daniel Schüle

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
 
D

Daniel Schüle

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
 
A

Assaph Mehr

Daniel said:
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
 
C

Charles Steinman

Daniel said:
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.
 
D

Daniel Schüle

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
 
J

James Edward Gray II

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=
 
D

Daniel Schüle

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,174
Messages
2,570,940
Members
47,484
Latest member
JackRichard

Latest Threads

Top