Color sequences in ri on Windows

By "ri colors" you mean invoking "ri Kernel.system" ?

If you used RubyInstaller releases, you should get:

No usage information available for this program
Note to developer: requested section(s) [Installing Documentation] not
found

But since you mention you generated yourself, this could be related to
rdoc-data, right?

I'm unaware of any command that turns ri ANSI color coding except if
the documentation was generated with these colors.

Can you check the ri yaml documents for these ANSI escape sequences?

···

On Sep 28, 8:14 pm, Eric Christopherson <echristopher...@gmail.com> wrote:

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?

--
Luis Lavena

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

(from ruby core)

···

On Tue, Sep 28, 2010 at 6:48 PM, Luis Lavena <luislavena@gmail.com> wrote:

On Sep 28, 8:14 pm, Eric Christopherson <echristopher...@gmail.com> > wrote:

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?

By "ri colors" you mean invoking "ri Kernel.system" ?

If you used RubyInstaller releases, you should get:

No usage information available for this program
Note to developer: requested section(s) [Installing Documentation] not
found

------------------------------------------------------------------------------
  system([env,] cmd [, arg, ...] [,options]) => true, false or nil

------------------------------------------------------------------------------
[etc.]

You're saying that a default RubyInstaller installation shouldn't have
any documentation for Kernel.system? That seems odd.

But since you mention you generated yourself, this could be related to
rdoc-data, right?

Oh, possibly; I do have the rdoc-data gem.

I'm unaware of any command that turns ri ANSI color coding except if
the documentation was generated with these colors.

Can you check the ri yaml documents for these ANSI escape sequences?

Where would I find those?

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

(from ruby core)
--------------------------------------------------------------------------- ---
system([env,] cmd [, arg, ...] [,options]) => true, false or nil

--------------------------------------------------------------------------- ---
[etc.]

You're saying that a default RubyInstaller installation shouldn't have
any documentation for Kernel.system? That seems odd.

No, we replaced ri documentation (due its bulkiness) with Windows Help
files (CHM)

> But since you mention you generated yourself, this could be related to
> rdoc-data, right?

Oh, possibly; I do have the rdoc-data gem.

> I'm unaware of any command that turns ri ANSI color coding except if
> the documentation was generated with these colors.

> Can you check the ri yaml documents for these ANSI escape sequences?

Where would I find those?

In your home directory there should be a folder named .ri

To know where is you home directory, execute "gem env path"

There should be two directories, one under your Ruby installation (C:
\RubyXYZ) and other inside Users or whatever is configured your system
to store your personal files.

Look for the kernel and system yaml files and see if there are ANSI
codes in them.

···

On Sep 28, 9:09 pm, Eric Christopherson <echristopher...@gmail.com> wrote:

--
Luis Lavena

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

···

--
Posted via http://www.ruby-forum.com/\.

> Can you check the ri yaml documents for these ANSI escape sequences?

Where would I find those?

In your home directory there should be a folder named .ri

To know where is you home directory, execute "gem env path"

There should be two directories, one under your Ruby installation (C:
\RubyXYZ) and other inside Users or whatever is configured your system
to store your personal files.

Oh, is that what that folder contains. I have been (kind of stupidly)
just deleting .ri and .gem in my home directory because I have my home
directory set up as a menu off the Start menu, and they always show up
as the first entries on the menu (which I don't want).

Is there a way I can get gem/rdoc/ri to keep their .ri and .gem
folders somewhere other than my home directory?

Look for the kernel and system yaml files and see if there are ANSI
codes in them.

Tomorrow I will try installing a gem and look in the .ri folder.

···

On Tue, Sep 28, 2010 at 11:00 PM, Luis Lavena <luislavena@gmail.com> wrote:

On Sep 28, 9:09 pm, Eric Christopherson <echristopher...@gmail.com> > wrote:

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.

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
versions of Windows.

···

On Thu, Sep 30, 2010 at 11:34 AM, Roger Pack <rogerpack2005@gmail.com> wrote:
from my recent reading on the subject, ansi.sys doesn't work in modern

[1]
http://groups.google.com/group/cukes/browse_thread/thread/14a4ded4d083f7c?pli=1
[2] http://support.microsoft.com/kb/101875
--
Posted via http://www.ruby-forum.com/\.

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).

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.

···

On Thu, Sep 30, 2010 at 11:34 AM, Roger Pack <rogerpack2005@gmail.com> wrote:

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

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.

···

On Sep 30, 4:43 pm, Eric Christopherson <echristopher...@gmail.com> wrote:

--
Luis Lavena

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.

It might work.

http://www.windowsnetworking.com/kbase/WindowsTips/Windows2000/UserTips/Miscellaneous/CommandInterpreterAnsiSupport.html

http://www.computing.net/answers/windows-xp/need-to-load-ansisys-on-xp-pro/22732.html

···

--
Posted via http://www.ruby-forum.com/\.