From owner-freebsd-hackers Tue Jul 4 16:18: 4 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from dt052n3e.san.rr.com (dt052n3e.san.rr.com [204.210.33.62]) by hub.freebsd.org (Postfix) with ESMTP id EF8EB37B5C3; Tue, 4 Jul 2000 16:17:54 -0700 (PDT) (envelope-from DougB@gorean.org) Received: from gorean.org (doug@master [10.0.0.2]) by dt052n3e.san.rr.com (8.9.3/8.9.3) with ESMTP id QAA03672; Tue, 4 Jul 2000 16:17:53 -0700 (PDT) (envelope-from DougB@gorean.org) Message-ID: <396270A1.8DDAC6FE@gorean.org> Date: Tue, 04 Jul 2000 16:17:53 -0700 From: Doug Barton Organization: Triborough Bridge & Tunnel Authority X-Mailer: Mozilla 4.72 [en] (X11; U; FreeBSD 5.0-CURRENT-0702 i386) X-Accept-Language: en MIME-Version: 1.0 To: John Baldwin Cc: Brian Fundakowski Feldman , Sean Lutner , hackers@FreeBSD.ORG, Sheldon Hearn Subject: Re: ls -G seems to depend on TERM=xterm-color References: <200007040841.BAA40774@john.baldwin.cx> Content-Type: multipart/mixed; boundary="------------E30BF601732EE42E16CCED76" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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