Color sequences in ri on Windows

  • Thread starter Eric Christopherson
  • Start date
E

Eric Christopherson

After installing some gems, the system recommended that I refresh ri
and rdoc. I may have actually updated the ri and rdoc programs too;
unfortunately I don't remember which commands I used. After that,
whenever I use ri the output is full of ANSI color sequences; I'm on
Windows (using 1.9.1p429 from RubyInstaller) using the Windows
console, so they don't display as color. I thought maybe installing
win32console would fix it, but it didn't.

So: What commands might I have typed that put color sequences into ri?
And how do I either remove the color sequences, or make them display
as color?
 
R

Roger Pack

Well, using Kernel.system as an example, I get:
â†[0mâ†[1;32mKernel.systemâ†[m

ri doesn't have a "--no-color" option?
It probably should (and used to work fine). Maybe take it up with them.
Until then you could try installing the win32-console gem, or pipe your
output through wac [1] or perhaps instruct your computer to load
ansi.sys [2] (though I've never tried the latter).


[1]
http://groups.google.com/group/cukes/browse_thread/thread/14a4ded4d083f7c?pli=1
[2] http://support.microsoft.com/kb/101875
 
E

Eric Christopherson

Well, using Kernel.system as an example, I get:
=E2=86=90[0m=E2=86=90[1;32mKernel.system=E2=86=90[m[/QUOTE]

ri doesn't have a "--no-color" option?
It probably should (and used to work fine). =C2=A0Maybe take it up with t=
hem.

Apparently it doesn't any longer. And I'm still a little confused as
to why ri output now has colors by default, though -- I don't know if
it's a change in ri, or if the new rdoc files I just installed have
colors embedded in them, or what. (I don't recall which ri files used
to display without colors.)

Also (this is to Luis), I tried removing and reinstalling some gems,
and I still don't have a .ri folder, nor have I found any YAML files
in my whole Ruby installation.
Until then you could try installing the win32-console gem, or pipe your
output through wac [1] or perhaps instruct your computer to load
ansi.sys [2] (though I've never tried the latter).

I did try win32console, but it didn't help. I will look into wac. And
from my recent reading on the subject, ansi.sys doesn't work in modern
versions of Windows.
 
L

Luis Lavena

Also (this is to Luis), I tried removing and reinstalling some gems,
and I still don't have a .ri folder, nor have I found any YAML files
in my whole Ruby installation.

ri documentation for gems is installed along the gem inside rubygems
directory.

Try this:

gem which win32console

And see the path that is output, one level above gems/win32console* is
where you could find "docs" directory for gems

Since you mention rdoc-data I pointed you to .ri in your home
directory because that is where it stores it.

I did try win32console, but it didn't help. I will look into wac. And
from my recent reading on the subject, ansi.sys doesn't work in modern
versions of Windows.

wac doesn't need ansi.sys, it mentions that emulates what ansi used to
do.
 
E

Eric Christopherson

Well, using Kernel.system as an example, I get:
=E2=86=90[0m=E2=86=90[1;32mKernel.system=E2=86=90[m[/QUOTE]

ri doesn't have a "--no-color" option?
It probably should (and used to work fine). =C2=A0Maybe take it up with t= hem.
Until then you could try installing the win32-console gem, or pipe your
output through wac [1] or perhaps instruct your computer to load
ansi.sys [2] (though I've never tried the latter).

I tried wac and it worked very well, for one day. But now it seems to
strip out the color codes without actually changing the text color.
Does anyone know what might cause that? I haven't changed anything
that I can think of, and wac doesn't have any config files or
anything, so I don't get it.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top