I've recently started using wirble to colorize my irb output and read that I needed to have the win32console gem to actually have color, otherwise I get color codes.
That has worked well until I noticed that my exception stack trace looked different and was missing information. I've narrowed it down to win32console.
Simple example without win32console:
irb(main):001:0> 1/0
ZeroDivisionError: divided by 0
from (irb):1:in `/'
from (irb):1
from C:/ruby193/bin/irb:12:in `<main>'
irb(main):002:0>
Simple example with win32console:
irb(main):003:0> 1/0
#<Class:0x57a7598>: divided by 0
from (irb):3:in `/'
from (irb):3
irb(main):004:0>
Is there a way to change it back but keep the colored output?
Found out this issue has been logged before and I guess never added to the actual gem see here since the posts are four years old.
Basically change a line s = t.dup.to_s
to s = t.to_s.dup
in lib\Win32\Console\ANSI.rb
in the def _PrintString(t)
method.