Mail Archives: djgpp/2000/09/27/13:45:40
Wolfgang Polzleitner <wp AT sensotech DOT at> wrote:
> I wanted to use ls with the color option, i.e.,
> and pipe the resulting output into less, i.e.,
> ls --color=yes -l | less
> The first part gives me nice colored output as expected, but 'less' does
> not display colors anymore. Instead it displays the escape characters
> like ESC[00m_bashrcESC[00m.
The key reason for this is that 'less' doesn't generally trust arbitrary
files to be displayable without causing some mayhem to the terminal
(making it unusable until reboot, or whatever) --- it's its Unix legacy
shining through, here.
That's why it will display Escape sequance literally, rather than just
executing them. You can switch that off by typing
-r<Return>
while less is running.
If that still doesn't work, that would mean 'less' doesn't have the
terminal escape sequence treatment built into it that 'ls' and 'bash'
have --- I don't have one here to check it.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -