From david@polymorf.fr  Sat Jun 19 08:44:38 2010
Return-Path: <david@polymorf.fr>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C583C1065672
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Jun 2010 08:44:38 +0000 (UTC)
	(envelope-from david@polymorf.fr)
Received: from mail2.polymorf.fr (ns2.polymorf.fr [80.247.227.220])
	by mx1.freebsd.org (Postfix) with ESMTP id 4EA6D8FC1E
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Jun 2010 08:44:38 +0000 (UTC)
Received: from beaver.polymorf.fr (localhost [127.0.0.1])
	by mail2.polymorf.fr (Postfix) with ESMTP id 75A4D2E4A6
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 19 Jun 2010 10:24:00 +0200 (CEST)
Received: from mail2.polymorf.fr ([127.0.0.1])
	by beaver.polymorf.fr (mail2.polymorf.fr [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id CwpkahmHJpDL for <FreeBSD-gnats-submit@freebsd.org>;
	Sat, 19 Jun 2010 10:23:54 +0200 (CEST)
Received: by mail2.polymorf.fr (Postfix, from userid 1006)
	id 047B92E4A2; Sat, 19 Jun 2010 10:23:54 +0200 (CEST)
Message-Id: <20100619082354.047B92E4A2@mail2.polymorf.fr>
Date: Sat, 19 Jun 2010 10:23:54 +0200 (CEST)
From: David BERARD <contact@davidberard.fr>
Reply-To: David BERARD <contact@davidberard.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: xterm-256color is a 8 colors terminal
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         147992
>Category:       conf
>Synopsis:       [termcap] [patch] xterm-256color is a 8 colors terminal
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gavin
>State:          patched
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 19 08:50:04 UTC 2010
>Closed-Date:    
>Last-Modified:  Sun Aug 08 10:02:28 UTC 2010
>Originator:     David BERARD
>Release:        FreeBSD 8.0-RELEASE-p3 amd64
>Organization:
>Environment:
System: FreeBSD beaver.polymorf.fr 8.0-RELEASE-p3 FreeBSD 8.0-RELEASE-p3 #3: Wed Jun 9 19:32:46 CEST 2010 root@beaver.polymorf.fr:/usr/obj/usr/src/sys/BEAVER amd64


>Description:
xterm-256color is an alias to xterm, so xterm-256color is a 8 colors terminal
>How-To-Repeat:
>Fix:
Apply the following patch and rebuild the termcap database (cap_mkdb /usr/share/misc/termcap)

--- termcap-xterm-256color.patch begins here ---
--- /usr/share/misc/termcap.old 2010-05-30 17:43:42.748620746 +0200
+++ /etc/termcap	2010-06-19 08:48:45.000000000 +0200
@@ -2985,7 +2985,7 @@
 # the extra features, but termcap applications still want the names.
 xterm-16color|xterm alias 1:tc=xterm-xfree86:
 xterm-88color|xterm alias 2:tc=xterm-256color:
-xterm-256color|xterm alias 3:tc=xterm-xfree86:
+xterm-256color|xterm alias 3:Co#256:tc=xterm-xfree86:
 xterm-nrc|xterm alias 4:tc=xterm:
 xterm-rep|xterm alias 5:tc=xterm:
 xterm-xmc|xterm alias 6:sg#1:tc=xterm:
--- termcap-xterm-256color.patch ends here ---


>Release-Note:
>Audit-Trail:

From: Anonymous <swell.k@gmail.com>
To: David BERARD <contact@davidberard.fr>
Cc: Ed Schouten <ed@FreeBSD.org>, bug-followup@FreeBSD.org
Subject: Re: conf/147992: xterm-256color is a 8 colors terminal
Date: Sun, 27 Jun 2010 13:33:36 +0400

 I don't think your patch is going to work because AB=\E[4%dm:AF=\E[3%dm
 are not what xterm uses in order to display 256 colors. Try smth like
 
   $ test_256_colors() { local i; while [ $((i+=1)) -le 256 ]; do tput AF $i; echo -n "$*"; done; tput me; }
   $ test_256_colors '&&&'
 
 then
 
   $ export TERMCAP="$TERM:AB=\E[48;5;%dm:AF=\E[38;5;%dm:$TERM"
   $ test_256_colors '&&&'
 
 Perhaps, r200369 will be MFC'd to /stable/8 when there is looming 8.1-RELEASE.

From: Chip Camden <sterling@camdensoftware.com>
To: bug-followup@FreeBSD.org, contact@davidberard.fr
Cc:  
Subject: Re: conf/147992: [termcap] [patch] xterm-256color is a 8 colors terminal
Date: Sat, 7 Aug 2010 13:28:27 -0700

 --NMuMz9nt05w80d4+
 Content-Type: multipart/mixed; boundary="XsQoSWH+UP9D9v3l"
 Content-Disposition: inline
 
 
 --XsQoSWH+UP9D9v3l
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 The patch is indeed inadequate.  I'm attaching a version that works.
 
 --=20
 Sterling (Chip) Camden    | sterling@camdensoftware.com | 2048D/3A978E4F
 http://camdensoftware.com | http://chipstips.com        | http://chipsquips=
 .com
 
 --XsQoSWH+UP9D9v3l
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch.txt"
 
 --- src/termcap	2010-06-11 07:53:21.000000000 -0700
 +++ /etc/termcap	2010-08-07 13:25:26.000000000 -0700
 @@ -2985,7 +2985,7 @@
  # the extra features, but termcap applications still want the names.
  xterm-16color|xterm alias 1:tc=xterm-xfree86:
  xterm-88color|xterm alias 2:tc=xterm-256color:
 -xterm-256color|xterm alias 3:tc=xterm-xfree86:
 +xterm-256color|xterm alias 3:Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt:
  xterm-nrc|xterm alias 4:tc=xterm:
  xterm-rep|xterm alias 5:tc=xterm:
  xterm-xmc|xterm alias 6:sg#1:tc=xterm:
 
 --XsQoSWH+UP9D9v3l--
 
 --NMuMz9nt05w80d4+
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.10 (FreeBSD)
 
 iQEcBAEBAgAGBQJMXcHrAAoJEIpckszW26+RRUwH/26qrvrhH2YIXHydfc8saXWu
 GUYpHcTQtxW2ikQGBrcpn5UFniCL28U8vPWo7eExzkr6LY+e/81uyQBzkUOJPi8A
 ZEk/QBpxC/FDCNUvuMYq8I6jn14EtYJiL/pOnIeZnuMk4V7R72+ShO13MMjRx1UQ
 HlTEnSQVRJBT5dciQCegGgRKXIU1xb1apLdYDA1EJisiSJJhq3csWJBKe1kM4Vcl
 4R/pBV0hRzX5Z+38kPEbOSuvyDZKOIDt1pmJM+rOtucE6caTd3r+G8+6rw93L9wn
 5izHKGNcDxYd8ylmF2Xr9csx09fLPHyWwN+xvYAfAaapQD1RAexCdKSlzw7ijoc=
 =L7IZ
 -----END PGP SIGNATURE-----
 
 --NMuMz9nt05w80d4+--
State-Changed-From-To: open->patched 
State-Changed-By: gavin 
State-Changed-When: Sun Aug 8 10:01:00 UTC 2010 
State-Changed-Why:  
Mark as patched, this is fixed in head. 

Needs r200369, r200503 and r202048 merging. 


Responsible-Changed-From-To: freebsd-bugs->gavin 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun Aug 8 10:01:00 UTC 2010 
Responsible-Changed-Why:  
I'll handle this 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147992 
>Unformatted:
