From nobody@FreeBSD.org  Tue Nov 30 18:42:05 2010
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C5ECB1065672
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Nov 2010 18:42:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (unknown [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id B41B28FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Nov 2010 18:42:05 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id oAUIg5Gc089611
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 30 Nov 2010 18:42:05 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id oAUIg5Gc089610;
	Tue, 30 Nov 2010 18:42:05 GMT
	(envelope-from nobody)
Message-Id: <201011301842.oAUIg5Gc089610@red.freebsd.org>
Date: Tue, 30 Nov 2010 18:42:05 GMT
From: Alexander Verbod <AlexJ@freebsd.forum>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] broken color support under rxvt-256color terminal and new entry for screen-256color in the termcap.
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         152713
>Category:       conf
>Synopsis:       [termcap] [patch] broken color support under rxvt-256color terminal and new entry for screen-256color in the termcap.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ed
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov 30 18:50:09 UTC 2010
>Closed-Date:    Fri Mar 11 19:44:24 UTC 2011
>Last-Modified:  Fri Mar 11 19:50:06 UTC 2011
>Originator:     Alexander Verbod
>Release:        8.1-RELEASE
>Organization:
>Environment:
FreeBSD test.private.local 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
I checked carefully latest termcap.src and found out that added
support for rxvt-256color in the PR: conf/147726 is incorrect.
There is omitted 'op' and 'pa' entry.
When TERM=rxvt-256color - base colors doesn't work as it should be.

>How-To-Repeat:
under rxvt-256color terminal run: 
ls -G
or
run 'sysinstall'

No color in both cases.
>Fix:
I submitted also PR: conf/152699 
that is claim:
"Terminfo include a definition for screen-256color, but termcap does not."

I combine fix patch for rxvt-256color and screen-256color together to be able
to fix both problems:
add a termcap entry for "screen-256color" terminal and
fix broken color support under "rxvt-256color".

Following patch may be applied to termcap.src revisions:
1.148.2.8 (RELENG_7: stable/7/share/termcap/termcap.src),
1.156.2.2 (RELENG_8: stable/8/share/termcap/termcap.src),
1.160 (MAIN: head/share/termcap/termcap.src)

diff was generated against head/share/termcap/termcap.src (revision 1.160)

Patch attached with submission follows:

*** termcap.src.orig.rev.1.160  2010-08-08 09:40:09.000000000 -0500
--- termcap.src 2010-11-30 09:35:30.000000000 -0500
***************
*** 2782,2791 ****
--- 2782,2793 ----
      :ut:tc=screen:
  SH|screen-s|VT 100/ANSI X3.64 virtual terminal with hardstatus line:\
      :ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen:
  SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\
      :co#132:tc=screen:
+ screen-256color|VT 100/ANSI X3.64 virtual terminal with 256 colors:\
+     :Co#256:pa#32767:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=screen:
  # $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $
  #
  # Note:
  #       termcap format is limited to 1023 characters.  This set of descriptions
  #       is a subset of the terminfo, since not all features can be fit into
***************
*** 4630,4640 ****

  rxvt|rxvt terminal emulator (X Window System):\
      :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:

  rxvt-256color|rxvt terminal emulator with 256 colors:\
!     :Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode:

  # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2
  Eterm|Eterm Terminal Emulator (X11 Window System):\
      :am:bw:eo:km:mi:ms:xn:xo:\
      :co#80:it#8:li#24:lm#0:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39m\E[49m:\
--- 4632,4642 ----

  rxvt|rxvt terminal emulator (X Window System):\
      :pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:

  rxvt-256color|rxvt terminal emulator with 256 colors:\
!     :Co#256:pa#32767:AF=\E[38;5;%dm:AB=\E[48;5;%dm:op=\E[39;49m:tc=rxvt-unicode:
  g: Signature made Tue Nov 30 12:20:39 2010 EST using RSA key ID 7C8EAF37
  # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2.com>"
  Eterm|Eterm Terminal Emulator (X11 Window System):\
      :am:bw:eo:km:mi:ms:xn:xo:\
      :co#80:it#8:li#24:lm#0:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39m\E[49m:\


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ed 
Responsible-Changed-By: ed 
Responsible-Changed-When: Mon Jan 3 15:56:21 UTC 2011 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152713 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/152713: commit references a PR
Date: Sat, 19 Feb 2011 11:06:09 +0000 (UTC)

 Author: ed
 Date: Sat Feb 19 11:06:00 2011
 New Revision: 218844
 URL: http://svn.freebsd.org/changeset/base/218844
 
 Log:
   Improve 256 color support.
   
   - Add screen-256color,
   - Improve rxvt-256color to set pa and op properly.
   - Add rxvt-unicode-256color as an alias to rxvt-256color.
   
   PR:		conf/152713, conf/153164
   Submitted by:	Alexander Verbod and Frédéric Perrin
   MFC after:	2 weeks
 
 Modified:
   head/share/termcap/termcap.src
 
 Modified: head/share/termcap/termcap.src
 ==============================================================================
 --- head/share/termcap/termcap.src	Sat Feb 19 10:36:05 2011	(r218843)
 +++ head/share/termcap/termcap.src	Sat Feb 19 11:06:00 2011	(r218844)
 @@ -2784,6 +2784,9 @@ SH|screen-s|VT 100/ANSI X3.64 virtual te
  	:ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen:
  SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\
  	:co#132:tc=screen:
 +screen-256color|VT 100/ANSI X3.64 terminal with 256 colors:\
 +	:Co#256:pa#32767:\
 +	:AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=screen:
  # $XTermId: termcap,v 1.78 2009/11/09 00:24:26 tom Exp $
  #
  # Note:
 @@ -4632,7 +4635,11 @@ rxvt|rxvt terminal emulator (X Window Sy
  	:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:
  
  rxvt-256color|rxvt terminal emulator with 256 colors:\
 -	:Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode:
 +	:Co#256:pa#32767:\
 +	:AB=\E[48;5;%dm:AF=\E[38;5;%dm:op=\E[39;49m:tc=rxvt-unicode:
 +
 +rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System):\
 +	:tc=rxvt-256color:
  
  # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2
  Eterm|Eterm Terminal Emulator (X11 Window System):\
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: ed 
State-Changed-When: Sat Feb 19 11:20:26 UTC 2011 
State-Changed-Why:  
Committed, with small modifications. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152713 
State-Changed-From-To: patched->closed 
State-Changed-By: ed 
State-Changed-When: Fri Mar 11 19:44:23 UTC 2011 
State-Changed-Why:  
Now part of 8.x! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=152713 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/152713: commit references a PR
Date: Fri, 11 Mar 2011 19:44:20 +0000 (UTC)

 Author: ed
 Date: Fri Mar 11 19:44:06 2011
 New Revision: 219529
 URL: http://svn.freebsd.org/changeset/base/219529
 
 Log:
   MFC r218844:
   
     Improve 256 color support.
   
     - Add screen-256color,
     - Improve rxvt-256color to set pa and op properly.
     - Add rxvt-unicode-256color as an alias to rxvt-256color.
   
     PR:           conf/152713, conf/153164
     Submitted by: Alexander Verbod and Frédéric Perrin
 
 Modified:
   stable/8/share/termcap/termcap.src
 Directory Properties:
   stable/8/share/termcap/   (props changed)
 
 Modified: stable/8/share/termcap/termcap.src
 ==============================================================================
 --- stable/8/share/termcap/termcap.src	Fri Mar 11 19:40:49 2011	(r219528)
 +++ stable/8/share/termcap/termcap.src	Fri Mar 11 19:44:06 2011	(r219529)
 @@ -2784,6 +2784,9 @@ SH|screen-s|VT 100/ANSI X3.64 virtual te
  	:ts=\E_:fs=\E\\:ds=\E_\E\\:tc=screen:
  SW|screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols:\
  	:co#132:tc=screen:
 +screen-256color|VT 100/ANSI X3.64 terminal with 256 colors:\
 +	:Co#256:pa#32767:\
 +	:AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=screen:
  # $Xorg: termcap,v 1.3 2000/08/17 19:55:10 cpqbld Exp $
  #
  # Note:
 @@ -4586,7 +4589,11 @@ rxvt|rxvt terminal emulator (X Window Sy
  	:pa#64:Co#8:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:tc=rxvt-mono:
  
  rxvt-256color|rxvt terminal emulator with 256 colors:\
 -	:Co#256:AF=\E[38;5;%dm:AB=\E[48;5;%dm:tc=rxvt-unicode:
 +	:Co#256:pa#32767:\
 +	:AB=\E[48;5;%dm:AF=\E[38;5;%dm:op=\E[39;49m:tc=rxvt-unicode:
 +
 +rxvt-unicode-256color|rxvt-unicode terminal with 256 colors (X Window System):\
 +	:tc=rxvt-256color:
  
  # Termcap entry for Eterm, taken from the sources of Eterm-0.9.2
  Eterm|Eterm Terminal Emulator (X11 Window System):\
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
