Win32::Console and IRB

Discussion in 'Ruby' started by Charles Roper, Sep 24, 2008.

  1. I'm using IRB with Wirble and Win32::Console in order to colorize the
    output. The coloring works, but whenever I hit backspace, the character
    to the left-1 gets eaten. E.g., if I type "test" and hit backspace, I'm
    left with "te t" (obviously the last "t" there should have been the
    character that got deleted).

    I thought this might be caused by Wirble at first, so I disabled this
    but the problem persisted. I tried disabling Win32::Console next and
    this cleared the problem. So it seems that Win32::Console and IRB aren't
    playing nicely together.

    Can anyone suggest a fix to this?

    Many thanks,
    Charles
    --
    Posted via http://www.ruby-forum.com/.
    Charles Roper, Sep 24, 2008
    #1
    1. Advertising

  2. Charles Roper

    Luis Lavena Guest

    Charles Roper wrote:
    > I'm using IRB with Wirble and Win32::Console in order to colorize the
    > output. The coloring works, but whenever I hit backspace, the character
    > to the left-1 gets eaten. E.g., if I type "test" and hit backspace, I'm
    > left with "te t" (obviously the last "t" there should have been the
    > character that got deleted).
    >
    > I thought this might be caused by Wirble at first, so I disabled this
    > but the problem persisted. I tried disabling Win32::Console next and
    > this cleared the problem. So it seems that Win32::Console and IRB aren't
    > playing nicely together.
    >
    > Can anyone suggest a fix to this?
    >
    > Many thanks,
    > Charles


    Hello Charles.

    The problem is not win32console by itself, but IRB:

    irb -f --noreadline

    Disabling readline functionality solves the problem, but affects
    autocompletion one, which is a bummer

    Until someone can came up with a pure-ruby readline library that replace
    the buggy C one, I think there is no easy solution.

    Sorry for not being more helpful.

    Regards,
    --
    Luis Lavena

    --
    Posted via http://www.ruby-forum.com/.
    Luis Lavena, Sep 27, 2008
    #2
    1. Advertising

  3. Luis Lavena wrote:

    > The problem is not win32console by itself, but IRB:
    >
    > irb -f --noreadline
    >
    > Disabling readline functionality solves the problem, but affects
    > autocompletion one, which is a bummer


    Hi Luis,

    Many thanks for this. This solved the problem (I put
    IRB.conf[:USE_READLINE] = false in my irbrc). I think I can live without
    auto-complete for now. I guess I can always switch between the two
    settings, depending on what I needs.

    You're right though, it is a bummer.

    Charles
    --
    Posted via http://www.ruby-forum.com/.
    Charles Roper, Oct 1, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sam Stephenson
    Replies:
    1
    Views:
    215
    Andrew Walrond
    Jun 18, 2005
  2. Replies:
    1
    Views:
    151
    Florian GroƟ
    Oct 26, 2005
  3. anne001
    Replies:
    1
    Views:
    257
    anne001
    Jun 27, 2006
  4. Replies:
    8
    Views:
    148
    Parv G.
    Oct 19, 2006
  5. Dr Nic

    My .irbrc for console/irb

    Dr Nic, Oct 12, 2006, in forum: Ruby
    Replies:
    12
    Views:
    188
    Louis J Scoras
    Oct 18, 2006
Loading...

Share This Page