I added to my .irbrc:
IRB.conf[:PROMPT].reverse_merge!(:RAILS_ENV => {:PROMPT_I=>"#{current_app} #{rails_env} #{prompt} ", :PROMPT_N=>"#{current_app} #{rails_env} #{prompt} ", :PROMPT_S=>nil, :PROMPT_C=>"?> ", :RETURN=>"=> %s\n"})
IRB.conf[:PROMPT_MODE] = :RAILS_ENV
If I do something like:
current_app = "\e[31mfoo_bar_app\e[0m"
rails_env = "\e[32m#{RAILS_ENV}\e[0m"
then the prompt shows up beautifully colorized, but if I copy some text into my copybuffer and paste it, if I do page-up/page-down to go to the beginning/end of the current text entered, my cursor like jumps to the middle of the text for page-up, and for page-down it jumps way out to the right into an area of blank spaces where nothing had been typed, then my cursor position is totally screwed up.
Is there a way I can correct this? I would really like a colorized prompt.