"more" command alternative that does support colors?
Most commands that can output color have an option to choose between:
- ON: Always output color
- OFF: Never output color
- AUTO: Show color if and only if the output is a terminal
Many commands work automatically in color AUTO mode. That is the case for emerge
. And that is why you do not have color when you pipe the output: the pioe is not a terminal.
The solution is to tell emerge
to output the colors unconditionally. And tell less
not to filter them, of course.
Try:
emerge --color y | less -R
Avio
Updated on July 17, 2022Comments
-
Avio almost 2 years
This is in my top 10 list of tiny annoying things in Linux. I love colored output in terminals: it's nice to see and useful when reading.
The first thing I do on a new system is to set aliases for both
ls
andgrep
to show colored output, and the second is to installvim
andhtop
.I use both Gentoo and Ubuntu, and I see that
emerge
, the package manager of Gentoo, has a higher readability thanapt-get/aptitude
just because it uses way much more color output than the latter.So, whenever I have to pipe an
emerge
command withmore
, all the color is lost and I have to focus my attention on every line to avoid missing anything important.I can understand that a basic command such as
more
shouldn't depend onncurses
(someone could argue that we also haveless
, so one of the two could be even color-friendly), but why there isn't a famous alternative tomore
that supports colors, as there is forvi/vim
,top/htop
etc.?Thanks for any hint.