Message-ID: <39D23EB2.5B7C0B57@sensotech.at> From: Wolfgang Polzleitner Organization: sensotech GmbH X-Mailer: Mozilla 4.72 [en]C-CCK-MCD NSCPCD47 (Win98; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: How can I get colors from ls to less References: <39D227C4 DOT 17D0A441 AT sensotech DOT at> <8qtbhg$5mt$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Lines: 60 Date: Wed, 27 Sep 2000 18:42:37 GMT NNTP-Posting-Host: 195.34.149.93 X-Complaints-To: abuse AT news DOT chello DOT at X-Trace: news.chello.at 970080157 195.34.149.93 (Wed, 27 Sep 2000 20:42:37 MET DST) NNTP-Posting-Date: Wed, 27 Sep 2000 20:42:37 MET DST To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Dear Hans-Bernhard: Many thanks for the hint with the -r command! This does work perfectly under Linux. I can even issue the command ls --color=yes -l | less -r and get the colors. However, in DJGPP bash the -r command changes the ESC into a single character (little arrow pointing left), i.e. the output looks like <-[00m_bashrc<-[00m where the <- is just one character. I wonder whether this is a non implemented feature in DJGPP bash, or a misconfiguration of some kind on my side. Any advice? Thanks a lot, Wolfgang -- Wolfgang Pölzleitner sensotech Forschungs- und Entwicklungs GmbH sensotech Research and Development Scheigergasse 74, A-8010 Graz, Austria T +43/316/429265, F +43/316/466037 e-mail: wp AT sensotech DOT at or polzleitner AT sensotech DOT at Hans-Bernhard Broeker wrote: > > Wolfgang Polzleitner 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 > > 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.