How to format irb command prompt

前端 未结 7 1195
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 17:40

Previously I was using Ruby 1.8 and my irb command prompt used to look like this:

Air ~: irb
>> a = 1
=> 1
>> b = 2
=> 2
>&         


        
7条回答
  •  孤城傲影
    2020-12-09 18:19

    To avoid giving the prompt you wish on the command line all the time, you can configure the prompt via the ~/.irbrc config file:

    $ echo "IRB.conf[:PROMPT_MODE] = :DEFAULT" > ~/.irbrc
    $ irb
    irb(main):001:0> quit
    $ echo "IRB.conf[:PROMPT_MODE] = :SIMPLE" > ~/.irbrc
    $ irb
    >> quit
    $ 
    

提交回复
热议问题