Ruby irb highlighting fails when using simple prompts

Issue #363 resolved
Anonymous created an issue

I always run irb with the option {{{ IRB.conf[:PROMPT_MODE] = :SIMPLE }}} When that option is enabled, Pygments can't highlight my pastes from irb.

(I personally believe that simple prompts should be the default for irb, since the standard prompt is much too long.)

Reported by guest

Comments (9)

  1. thatch

    Simple prompts actually are the default on OS X Leopard. Here's an example:

    >> puts "Hi" +
    ?> 123.to_s
    => nil
    >> blah
    NameError: undefined local variable or method `blah' for main:Object
    	from (irb):13

    This highlights correctly with [38e669d11284], not yet in -main.

  2. thatch

    There's a followup commit in [6f317b427b60] which fixes multiline strings using long prompts, but it looks like multiline strings with short prompts will be very difficult since there's no leader on continued lines.

    >> '
    => "\\n\\nabc\\n"
  3. Log in to comment