From jaymecox@coyote.rain.org  Ukn Nov 13 03:11:10 1993
Received:  by rain.org (4.1/25-eef)
	id AA25055; Sat, 13 Nov 93 01:08:34 PST
Date: Sat, 13 Nov 1993 01:07:40 -0800 (PST)
From: Jayme Cox <jaymecox@coyote.rain.org>
Subject: new-color-ls.man.patch
To: "Patrick J. Volkerding" <volkerdi>
In-Reply-To: <Pine.3.07.9311111349.B23261-9100000@mhd1.moorhead.msus.edu>
Message-Id: <Pine.3.05.9311130139.B24986-d100000@coyote.rain.org>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: RO
X-Status: 



*** ls.1.old	Fri Nov 12 22:53:29 1993
--- ls.1	Fri Nov 12 23:32:26 1993
***************
*** 1,8 ****
! .TH LS 1L "GNU File Utilities" "FSF" \" -*- nroff -*-
  .SH NAME
  ls, dir, vdir \- list contents of directories
  .SH SYNOPSIS
  .B ls
! [\-abcdfgiklmnpqrstuxABCFGLNQRSUX1] [\-w cols] [\-T cols] [\-I pattern]
  [\-\-all] [\-\-escape] [\-\-directory] [\-\-inode] [\-\-kilobytes]
  [\-\-numeric-uid-gid] [--no-group] [\-\-hide-control-chars] [\-\-reverse]
--- 1,8 ----
! .TH LS 1 "GNU File Utilities 3.9" "FSF" \" -*- nroff -*-
  .SH NAME
  ls, dir, vdir \- list contents of directories
  .SH SYNOPSIS
  .B ls
! [\-abcdfgiklmnopqrstuxABCFGLNQRSUX1] [\-w cols] [\-T cols] [\-I pattern]
  [\-\-all] [\-\-escape] [\-\-directory] [\-\-inode] [\-\-kilobytes]
  [\-\-numeric-uid-gid] [--no-group] [\-\-hide-control-chars] [\-\-reverse]
***************
*** 10,13 ****
--- 10,14 ----
  [\-\-ignore-backups] [\-\-classify] [\-\-file-type] [\-\-full-time]
  [\-\-ignore=pattern] [\-\-dereference] [\-\-literal] [\-\-quote-name]
+ [\-\-color] [\-\-no\-color] [\-\-7bit] [\-\-8bit]
  [\-\-recursive] [\-\-sort={none,time,size,extension}]
  [\-\-format={long,verbose,commas,across,vertical,single-column}]
***************
*** 63,67 ****
  .I \-t.
  .TP
! .I "\-\-full-time"
  List times in full, rather than using the standard abbreviation
  heuristics.
--- 64,68 ----
  .I \-t.
  .TP
! .I "\-\-full\-time"
  List times in full, rather than using the standard abbreviation
  heuristics.
***************
*** 89,95 ****
  separated by commas.
  .TP
! .I "\-n, \-\-numeric-uid-gid"
  List the numeric UID and GID instead of the names.
  .TP
  .I \-p
  Append a character to each file name indicating the file type.
--- 90,101 ----
  separated by commas.
  .TP
! .I "\-n, \-\-numeric\-uid\-gid"
  List the numeric UID and GID instead of the names.
  .TP
+ .I "\-o, \-\-color"
+ Colorize the names of files using ISO 6429 (ANSI) color control
+ sequences, depending on the file type and/or the extension. See
+ `DISPLAY COLORIZATION' below.
+ .TP
  .I \-p
  Append a character to each file name indicating the file type.
***************
*** 205,208 ****
--- 211,275 ----
  .I "\-\-version"
  Print version information on standard output then exit successfully.
+ .SS DISPLAY COLORIZATION
+ When using the
+ .I "\-o"
+ or
+ .I "\-\-color"
+ options, this version of
+ .B ls
+ will colorize the file names printed according to the type of file.
+ .PP
+ You can override the default colors by defining the environment
+ variable 
+ .B LS_COLORS
+ (or 
+ .BR LS_COLOURS );
+ this should be a comma-separated
+ list of codes that will be inserted into a color escape sequence (type
+ `m').  The sequences are, in order: plaintext, normal file, directory,
+ symbolic link, FIFO, socket, block device, character device, and
+ executable file.  The first sequence (plaintext) is the one applied to
+ the end of each file name in order to restore normal text output.
+ This is usually, but not always, a zero (0). Certain file extensions are
+ also colorized. Currently this is hard coded into the ls.c file and should
+ be made into a user definable option. Colorized extensions include:
+ .nf
+ {.cmd .com .bat .btm .exe} get executable colarization
+ {.tar .tgz .zoo .arj .zip .taz .lzh .z .Z .gz} are bright red
+ {.jpg .gif .bmp .voc .mod .wav} get bright purple
+ {.dll .sys .drv .ini .txt .doc} get bright white
+ {.c .o .h} get red, blue and green respectivly
+ .fi
+ .PP
+ A single color sequence is composed of numerical commands separated by
+ semicolons.  The most common commands are:
+ .nf
+  0 to restore default color
+  1 for brighter colors 
+  4 for underlined text
+  5 for flashing text
+ 30 for black foreground
+ 31 for red foreground
+ 32 for green foreground
+ 33 for yellow (or brown) foreground
+ 34 for blue foreground
+ 35 for purple foreground
+ 36 for cyan foreground
+ 37 for white (or gray) foreground
+ 40 for black background
+ 41 for red background
+ 42 for green background
+ 43 for yellow (or brown) background
+ 44 for blue background
+ 45 for purple background
+ 46 for cyan background
+ 47 for white (or gray) background
+ .fi
+ .PP
+ Not all commands work on all systems or display devices.
+ .PP
+ The default value for 
+ .B LS_COLORS 
+ is `00,00,36;01,35;01,33;01,35;00,33;01,33;01,32;01'.
  .SH BUGS
  On BSD systems, the
***************
*** 215,216 ****
--- 282,292 ----
  .B ls
  program.
+ .SH TODO
+ Need to make the colorization of file extensions user definable so that
+ users can set what extensions recieve what colors. Colorizations and
+ character set selection need to be more system independent. Using the
+ colorization option disables the use of the tab character for column
+ spacing unless the
+ .I \-T
+ option is used; apparently some systems don't like tabs and colors in
+ conjunction.



