Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 Jul 2000 16:17:53 -0700
From:      Doug Barton <DougB@gorean.org>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Brian Fundakowski Feldman <green@FreeBSD.ORG>, Sean Lutner <sean@rentul.net>, hackers@FreeBSD.ORG, Sheldon Hearn <sheldonh@uunet.co.za>
Subject:   Re: ls -G seems to depend on TERM=xterm-color
Message-ID:  <396270A1.8DDAC6FE@gorean.org>
References:  <200007040841.BAA40774@john.baldwin.cx>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------E30BF601732EE42E16CCED76
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

John Baldwin wrote:
> 
> On 04-Jul-00 Doug Barton wrote:
> > John Baldwin wrote:
> >
> >> >> XTerm*termName: xterm-color
> >> >
> >> >       Ok, that's a good solution, I was just using .bashrc. My point is not
> >> > so much why, but that it be properly documented. Do you want to handle
> >> > the update of the ls man page, or do you want me to PR a patch?
> >>
> >> Umm, honestly, this shouldn't be all that non-obvious.  Do you expect
> >> ls -G to work on a monochrome monitor?  Of course not. :P  The xterm
> >> termcap is by default a monochrome terminal.  sysinstall doesn't have
> >> color in an xterm either w/ term=xterm.
> >
> >       This is obvious to you and me, but to a newer user it's not going to be
> > obvious at all. There is going to be a bunch of people who write into
> > the mailing lists wondering why they aren't seeing the colorized ls in
> > their xterms.
> 
> Well, then you are going to have to document this for every single color
> program people might want to run in an xterm. :) 

	And the problem with that would be what, exactly? 

> Seriously, educating the
> users on termcap will probably be a more productive way of going about this.
> One way of doing this might be to add a FAQ entry along the lines of
> "Programs such as ls(1) and sysinstall(8) don't display color in my xterm
> or other terminal?"

	I agree that user education is a noble goal, and if you didn't already
realize it, one that I have supported with my own efforts for a long
time. However, I can see the "writing on the wall" regarding user
confusion over the color ls issue. This _specific_ feature has been
often requested by users on -questions, most of whom (dare I say it?)
are recent linux converts. Therefore, with this _specific_ feature it
will pay off more in both the long and short terms if we put the cookies
down a few shelves to start with, and add an enticement for them to eat
some meat and potatoes when they are ready. 

	So, I've put my time where my mouth is and produced the attached patch
for ls.1. I am 100% open to modifications of both style and content, my
only request being that someone commit _something_ before 4.1 goes out
the door. Since Andrey MFC'ed the color bits already (a welcome move,
don't get me wrong) there is slightly more urgency to this matter then
there was previously. John, when your FAQ entry is done, please feel
free to add it to the SEE ALSO section of ls.1. :)

Doug
-- 
        "Live free or die"
		- State motto of my ancestral homeland, New Hampshire

	Do YOU Yahoo!?
--------------E30BF601732EE42E16CCED76
Content-Type: text/plain; charset=us-ascii;
 name="ls.1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="ls.1.diff"

Index: ls.1
===================================================================
RCS file: /usr/ncvs/src/bin/ls/ls.1,v
retrieving revision 1.38
diff -u -r1.38 ls.1
--- ls.1	2000/06/22 10:07:46	1.38
+++ ls.1	2000/07/04 22:56:57
@@ -100,6 +100,20 @@
 In addition to those mentioned above in
 .Fl F ,
 some extra attributes (setuid bit set, etc.) are also displayed.
+The colorization is dependent on a terminal type with the proper
+.Xr termcap 5
+capabilities.
+The default
+.Dq cons25
+console has the proper capabilities,
+however if you want to display the colors in an
+.Xr xterm 1
+for example,
+you need to set your
+.Ev TERM
+variable to
+.Dq xterm-color .
+Other terminal types may require similar adjustments.
 .It Fl H
 Symbolic links on the command line are followed.  This option is assumed if
 none of the
@@ -478,6 +492,10 @@
 columns have changeable widths.  The fields are,
 in order: inode, block count, number of links, user name,
 group name, flags, file size, file name.
+.It Ev TERM
+The
+.Fl G
+option depends on a terminal type with color capabilities.
 .It Ev TZ
 The timezone to use when displaying dates.
 See
@@ -492,6 +510,8 @@
 .Sh SEE ALSO
 .Xr chflags 1 ,
 .Xr chmod 1 ,
+.Xr xterm 1 ,
+.Xr termcap 5 ,
 .Xr symlink 7 ,
 .Xr sticky 8
 .Sh HISTORY

--------------E30BF601732EE42E16CCED76--



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?396270A1.8DDAC6FE>