Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 May 1996 21:01:30 -0700 (PDT)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        chuckr@Glue.umd.edu
Cc:        mark@grondar.za, freebsd-chat@freebsd.org, ache@freebsd.org, ports@freebsd.org
Subject:   Re: LESS cleanup?
Message-ID:  <199605130401.VAA01635@silvia.HIP.Berkeley.EDU>
In-Reply-To: <Pine.OSF.3.91.960512190256.30172C-100000@gilligan.eng.umd.edu> (message from Chuck Robey on Sun, 12 May 1996 19:04:55 -0400 (EDT))

next in thread | previous in thread | raw e-mail | index | archive | help
 * OK, I played with the color less ... I did an ls |less, and since I'm 
 * using a color version of ls, colors came out.  What surprised me is that 
 * the columns were all messed up.  Do you think less is misinterpreting the 
 * color escape sequences as taking tab positions? 

Yes.  Take a look at the patch (files/patch-ab), it just lets the Esc
pass through (at least I think that's what it's doing...).

It should 

 * Does anyone know of a reference to what those color sequences are?

I guess it's ANSI one thing or another 'cause they are usually called
"ANSI color sequences".  They are

Esc '[' '3' c 'm' to set the foreground, and
Esc '[' '4' c 'm' to set the background

where c is the color code 0-7, where it's usually that 1 is red, 2 is
green, 4 is blue and other numbers are bitwise OR's of the three
colors.

There is also an

Esc '[' m

to reset the color to the default.  (Actually it resets everything,
like blink/bold/underline etc., which can be accessed by using digits
other than '3' and '4' after the '[').

Satoshi "no I didn't invent colorls, I just implemented it"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605130401.VAA01635>