Color in Mac OS X's Terminal for RI

Hi Rubyists,

I’m wondering why I can’t have colors for ri in my Terminal.app

Well, I tried this command (ri -f ansi Hash) with 3 interpreters:
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0] => doesn’t
work, I get some ESC[1m
ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin9.8.0] => doesn’t
work, I
get some ESC[1m

jruby 1.4.0RC3 (ruby 1.8.7 patchlevel 174) (2009-10-28 d0f6289) (Java
HotSpot™ Client VM 1.5.0_20) [i386-java]
=> WORK (but not so cool colors… that’s another subject…)

The difference I see is jruby output directly to the STDOUT, while the
ruby
interpreters use less, which seem to not work good with these
colors…

In fact I’m resolving myself my own problem …

Using -T(–no-pager) send directly to STDOUT, what works.

So my question is: why less doesn’t accept colors?

P.S.: Anyway I’ve aliased ri to “ri --no-pager -f ansi”, and I’m happy
since
I don’t like so much these pagers…

Enjoy Ruby !

Benoit D. [email protected] wrote:

Anyway I’ve aliased ri to “ri --no-pager -f ansi”

Or alternatively export RI as ‘-T -f ansi’.