Mail Archives: djgpp/2000/09/29/01:46:11
> From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
> Newsgroups: comp.os.msdos.djgpp
> Date: 27 Sep 2000 17:42:08 GMT
>
> > 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>
It won't help: Less doesn't ``execute'' escape sequences, that is, it
doesn't convert them to color commands. Instead, it uses direct video
writes (the conio functions) to display colored text, but only if the
original text includes bold and underlined characters simulated by
backspace-overstrike method. Escape sequences are handled as simple
non-printable characters.
> 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
Exactly: Less doesn't have (and doesn't need to have) the code which
emulates an ANSI console driver.
- Raw text -