From juhis@tykki.ath.cx  Fri Aug  1 06:46:02 2003
Return-Path: <juhis@tykki.ath.cx>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BD02D37B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  1 Aug 2003 06:46:02 -0700 (PDT)
Received: from fep06.tmt.tele.fi (hank-fep6-0.inet.fi [194.251.242.201])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5E86D43FDF
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  1 Aug 2003 06:46:01 -0700 (PDT)
	(envelope-from juhis@tykki.ath.cx)
Received: from tykki.ath.cx ([80.222.40.240]) by fep06.tmt.tele.fi
          (InterMail vM.5.01.03.13 201-253-122-118-113-20010918) with ESMTP
          id <20030801134559.ELXU13416.fep06.tmt.tele.fi@tykki.ath.cx>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Fri, 1 Aug 2003 16:45:59 +0300
Received: by tykki.ath.cx (Postfix, from userid 2001)
	id 214B215236; Fri,  1 Aug 2003 16:45:58 +0300 (EEST)
Message-Id: <20030801134558.214B215236@tykki.ath.cx>
Date: Fri,  1 Aug 2003 16:45:58 +0300 (EEST)
From: Juha-Matti Tilli <juhis@nallukka.net>
Reply-To: Juha-Matti Tilli <juhis@nallukka.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] The termcap entry for screen is old
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55146
>Category:       misc
>Synopsis:       [PATCH] The termcap entry for screen is old
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ache
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 01 06:50:18 PDT 2003
>Closed-Date:    Sat Mar 20 01:59:20 PST 2004
>Last-Modified:  Sat Mar 20 01:59:20 PST 2004
>Originator:     Juha-Matti Tilli
>Release:        FreeBSD 5.0-RELEASE-p6 i386
>Organization:
>Environment:
System: FreeBSD tykki.juhis.lan 5.0-RELEASE-p6 FreeBSD 5.0-RELEASE-p6 #0: Sun Mar 23 16:44:53 EET 2003 juhis@tykki.juhis.lan:/varasto/obj/usr/src/sys/TYKKI i386

>Description:

The termcap entry for screen is old and does not have end key.

>How-To-Repeat:

% screen
% ssh localhost
% less somefile

The end key does not work in less and vim.

Screen sets the correct termcap entry in TERMCAP environment variable. But when
you connect to some machine with ssh, TERMCAP is not preserved and the old
entry in /usr/share/misc/termcap is used instead.

>Fix:

Use the termcap entry that comes with screen.

Here is a patch for version 1.132 of termcap.src:

--- /usr/src/share/termcap/termcap.src.old	Sat Sep 28 06:40:19 2002
+++ /usr/src/share/termcap/termcap.src	Fri Aug  1 16:28:12 2003
@@ -2722,16 +2722,20 @@
 	:li#24:co#80:us=\E[4m:ue=\E[24m:so=\E[3m:se=\E[23m:\
 	:mb=\E[5m:md=\E[1m:mr=\E[7m:me=\E[m:sr=\EM:al=\E[L:\
 	:AL=\E[%dL:dl=\E[M:DL=\E[%dM:cs=\E[%i%d;%dr:dc=\E[P:\
-	:DC=\E[%dP:ic=\E[@:IC=\E[%d@:\
+	:DC=\E[%dP:im=\E[4h:ei=\E[4l:IC=\E[%d@:\
 	:ks=\E[?1h\E=:ke=\E[?1l\E>:vb=\Eg:\
 	:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
 	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
 	:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:F1=\E[23~:F2=\E[24~:\
-	:kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:kP=\E[5~:kN=\E[6~:\
-	:eA=\E(B\E)0:as=^N:ae=^O:\
+	:kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:@7=\E[4~:kP=\E[5~:\
+	:kN=\E[6~:eA=\E(B\E)0:as=^N:ae=^O:ti=\E[?1049h:te=\E[?1049l:\
 	:vi=\E[?25l:ve=\E[34h\E[?25h:vs=\E[34l:\
 	:Co#8:pa#64:AF=\E[3%dm:AB=\E[4%dm:op=\E[39;49m:AX:\
-	:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhii00:
+	:ac=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~..--++,,hhII00:
+SB|screen-bce|VT 100/ANSI X3.64 virtual terminal with bce:\
+	: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:
 # $Xorg: termcap,v 1.3 2000/08/17 19:55:10 cpqbld Exp $

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ache 
Responsible-Changed-By: roam 
Responsible-Changed-When: Tue Aug 5 00:04:06 PDT 2003 
Responsible-Changed-Why:  
Over to our de-facto termcap maintainer. 
The patch in the PR looks good to me, and it does indeed fix 
the *very* annoying problem with the End key in vi-lookalikes. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55146 
State-Changed-From-To: open->patched 
State-Changed-By: ache 
State-Changed-When: Tue Aug 5 01:06:54 PDT 2003 
State-Changed-Why:  
Committed into -current 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55146 
State-Changed-From-To: patched->closed 
State-Changed-By: schweikh 
State-Changed-When: Sat Mar 20 01:58:38 PST 2004 
State-Changed-Why:  
Committed to RELENG_4 with latest catch-up to CURRENT. Thanks! 

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