What can I do to display colors in less?? Or should I use another pager??
Cheers!
P.S. Of course, in this case I can just run qpkg with -nc atribut (no color). But I have this problem with other commands that do not support no-color-mode. Also, I hate to use more._________________Registred Linux user #191143!
Abit NF7-S rev. 2.00 (BIOS v. 2.7)
AMD AthlonXP 2500+ (Barton)
PATA Seagate ST3120022A
SATA Seagate ST3200822AS & Silicon Image 3112 chipset
Gentoo Linux

I don't think either less or more are capable of displaying the colours, only stripping out the control characters. I don't know if there is going to be a simple solution to this problem, it may have to do with how less and more have to keep redrawing the display that they are discarded.

Here is a follow up question. Why is "emerge -s phoenix" (or any other package) colorized, while "emerge -s phoenix | more" is not?

I think it is something in emerge that checks if it's output is the terminal or a pipe I say this because qpkg still colorizes the output when piped or redirected, unless you specify the --nocolor option. I don't know if there is any way to change this without modifying emerge, nothing listed in the man page.

joycea, did you not read any of the previous posts? Both less and more can display color.

What typcally happens is that programs check to see whether the stdout is a tty, and if it isn't they (by default) turn off all fancy stuff like color. This still allows you to use color if you want, by specifying explicit options. The theory is that if the stdout isn't a tty then it is probably a pipeline where you want to deal with the raw data. An example would be:

Code:

qpkg -I | wc

where you don't want all the colorizing stuff to end up in the character count.

So in other words, both qpkg and emerge need an explicit "--color" option that would force the output to include the control characters even if it's going into the pipe; and without it both programs should check whether they are outputting into a tty, and based on that include or exclude the control information? Just trying to make sure I understood you correctly.

Wow, 2004... Well, emerge still doesn't do this by default, so I spent a long while accepting monochrome paged output until I found this thread and poked around the manpages for less and emerge. In case it helps someone else, the following is a working combination of the two:

Code:

emerge --color y | less

That is, less doesn't need -r or -R in this chain. The hint to emerge takes care of it.