On Sat, Nov 25, 2006 at 03:06:04AM +0100, Penguin Lover Thomas R?sner squawked:
> This is for programs having color output you want to pipe to less, not 
> less showing a syntax highlighted file. This is done by the gentoo less 
> filter that automagically unzips README.gz files when viewing them with 
> less, fx. Does ls --color=auto produce colors in your xterm? Is your 
> TERM envvar set to xterm (xterm should do this)? Do you have compared 
> the current /etc/skel files to your user's home; when you create a new 
> user with those files in his home, does xterm/less work for this account 
> as intended?

Oh jeez, I completely misunderstood the original post (not to mention
that I didn't realize the colourisation is a gentoo specific filter).
I just took a look at the filter program 'lesspipe.sh', and boy is it
nice! Even extracts mp3info/ogginfo (not that I'd have thought about
running less against mp3 or ogg-vorbis files before)!

But I don't think the TERM envvar is the issue here (OP should check it 
in any case). On my rxvt term, I run 
  TERM=<insertsomething> less <somesrcfile>
if I set the TERM to something that doesn't support color (dumb, or
some nonsense term), less (/usr/bin/less, not the lesspipe.sh) would
complain that it is not compatible with the -R option (which should be
set for all users in /etc/env.d/70less anyway), yet at the same time,
it would still send all the ANSI color codes produced by lesspipe.sh
as raw to the terminal, and the output still displays as colored. 

Just checking, in the xterm that doesn't work, what does the following
envvars show?

LESS   (should be -R -M --shift 5 by default)
LESSOPEN   (|lesspipe.sh %s)
LESSCOLOR  (should be empty by default)
LESSCOLORIZER  (ditto)

HTH, 

W
-- 
A grenade thrown into a kitchen in France would result in Linoleum Blownapart.
Sortir en Pantoufles: up 92 days,  7:43
-- 
gentoo-user@gentoo.org mailing list

Reply via email to