public
Last active

running irb from rvm does not use the prompt-mode option

  • Download Gist
rvm_irb_prompt_mode
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
UPDATE by peter_v 2010-12-19 15:53:00
* the issue also occurs with rvm use system
* so not related to rvm, but to irb
* discussed on irc with telemachus
 
peterv@ASUS:~$ rvm --version
 
rvm 1.1.6 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
 
peterv@ASUS:~$ rvm use
Now using system ruby.
peterv@ASUS:~$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
 
peterv@ASUS:~$ irb # with system ruby
irb(main):001:0> IRB.conf[:PROMPT_MODE]
=> :DEFAULT
irb(main):002:0> quit
peterv@ASUS:~$ irb --prompt-mode xmp
# this works as expected, PROMPT_I == nil
IRB.conf[:PROMPT_MODE]
==>:XMP
IRB.conf[:PROMPT][:XMP][:PROMPT_I]
==>nil
quit
 
peterv@ASUS:~$ rvm use 1.9.2 # now switching to one of the rvm supplied Ruby's
Using /home/peterv/.rvm/gems/ruby-1.9.2-p0
peterv@ASUS:~$ irb
ruby-1.9.2-p0 :001 > IRB.conf[:PROMPT_MODE]
=> :RVM
ruby-1.9.2-p0 :002 > IRB.conf[:PROMPT][:RVM][:PROMPT_I]
=> "ruby-1.9.2-p0 :%03n > "
ruby-1.9.2-p0 :003 > # this works as expected, RVM supplies its own prompt mode
ruby-1.9.2-p0 :004 > quit
 
peterv@ASUS:~$ irb --prompt-mode xmp
ruby-1.9.2-p0 :001 > IRB.conf[:PROMPT_MODE]
=> :RVM
ruby-1.9.2-p0 :002 > # this is not expected, irb under rvm, seems not
ruby-1.9.2-p0 :003 > # to use the --prompt-mode option from the command line
ruby-1.9.2-p0 :004 > quit
 
peterv@ASUS:~$ rvm use 1.8.7
Using /home/peterv/.rvm/gems/ruby-1.8.7-p302
peterv@ASUS:~$ irb --prompt-mode xmp
ruby-1.8.7-p302 :001 > IRB.conf[:PROMPT_MODE]
=> :RVM # same behavior on ruby 1.8.7
ruby-1.8.7-p302 :002 > quit
 
UPDATE by peter_v : the issue also occurs with rvm use system
 
I now installed a ~/.irbrc file
 
peterv@ASUS:~$ rvm use system
Now using system ruby.
peterv@ASUS:~$ irb --prompt-mode xmp
quit
peterv@ASUS:~$ irb --prompt-mode xmp
001:0> IRB.conf[:PROMPT_MODE]
=> :CUSTOM ### this was expected to be :XMP

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.