# Win32::Console and IRB

**URL:** <https://www.ruby-forum.com/t/win32-console-and-irb/149416>\
**Category:** Ruby\
**Created:** [September 24, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/win32-console-and-irb/149416 "2008-09-24T17:11:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![scrajesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@scrajesh](https://www.ruby-forum.com/u/scrajesh)\
**Post date:** [September 24, 2008, 5:11pm UTC](https://www.ruby-forum.com/t/win32-console-and-irb/149416/1 "2008-09-24T17:11:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![scrajesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@scrajesh](https://www.ruby-forum.com/u/scrajesh)\
**Post date:** [September 27, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/win32-console-and-irb/149416/2 "2008-09-27T23:37:08Z")

</div>

Charles R. 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 L.

---

<div class="post-metadata">

**Author:** ![scrajesh](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/46a35a/32.png) [@scrajesh](https://www.ruby-forum.com/u/scrajesh)\
**Post date:** [October 1, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/win32-console-and-irb/149416/3 "2008-10-01T16:52:23Z")

</div>

Luis L. 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
