Bug 132199

Summary: Errors in the "screen" terminal description termcap
Product: Base System Reporter: Timur I. Bakeyev <timur>
Component: confAssignee: Rong-En Fan <rafan>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 7.1-STABLE   
Hardware: Any   
OS: Any   

Description Timur I. Bakeyev freebsd_committer freebsd_triage 2009-02-28 17:00:09 UTC
	In ncurses applications, namely MC with TERM=screen 'End' button
	doesn't produce any effect.

Fix: 

I thought about it as some bug in ncurses, until I came across:
	
	http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92215
	
	Date: Fri, 30 Mar 2001 16:48:13 UTC
	Severity: normal
	Found in versions 5.2.20010318-1, 5.2.20020112a-8
	
	> The problem is that kll is defined to be the same value as
	> kend, and (apparently) ncurses checks kll before kend...
	
	Although, it is related to the terminfo, apparently, our termcap
	was generated from the same source, as it contains:
	
	SC|screen|VT 100/ANSI X3.64 virtual terminal:\
	....
	:kh=\E[1~:kI=\E[2~:kD=\E[3~:kH=\E[4~:@7=\E[4~:kP=\E[5~:\
	
	Where:
	
	key_ll   kll        kH        lower-left key (home down)
	key_end  kend       @7        end key
	
	I'd suggest to use the same approach as Debian used, as kH seems
	close to non-existing, when End key is quite frequent and usefull.

	With regards,
	Timur.
How-To-Repeat: 	Compile latest MC from the ports with ncurses and run it under
	'screen'. Press 'End' button - nothing happens, you can't teach MC
	this button either.
Comment 1 Rong-En Fan freebsd_committer freebsd_triage 2009-03-01 07:02:12 UTC
Responsible Changed
From-To: freebsd-bugs->rafan

I'll take it.
Comment 2 dfilter service freebsd_committer freebsd_triage 2009-03-01 07:08:59 UTC
Author: rafan
Date: Sun Mar  1 07:08:46 2009
New Revision: 189216
URL: http://svn.freebsd.org/changeset/base/189216

Log:
  - Remove kH (kp_kll) from screen. It has the identical key sequence as
    @7 (kp_end). As ncurses has the limitation that it returns the first
    matched key symbol, you can not use END in ncurses based program under
    screen (like ports/misc/mc).
  
  We did similar changes to xterm entry last year for exactly the same reason.
  
  PR:		132199
  Submitted by:	Timur I. Bakeyev <timur at FreeBSD.org>
  MFC after:	2 month

Modified:
  head/share/termcap/termcap.src

Modified: head/share/termcap/termcap.src
==============================================================================
--- head/share/termcap/termcap.src	Sun Mar  1 07:06:44 2009	(r189215)
+++ head/share/termcap/termcap.src	Sun Mar  1 07:08:46 2009	(r189216)
@@ -2771,7 +2771,7 @@ SC|screen|VT 100/ANSI X3.64 virtual term
 	: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~:@7=\E[4~:kP=\E[5~:\
+	:kh=\E[1~:kI=\E[2~:kD=\E[3~:@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:\
_______________________________________________
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"
Comment 3 Rong-En Fan freebsd_committer freebsd_triage 2009-03-01 08:08:34 UTC
State Changed
From-To: open->patched

Fix committed into HEAD. Will MFC in 2 months.
Comment 4 dfilter service freebsd_committer freebsd_triage 2009-03-17 14:29:52 UTC
Author: rafan
Date: Tue Mar 17 14:29:25 2009
New Revision: 189930
URL: http://svn.freebsd.org/changeset/base/189930

Log:
  MFC r189216 (ahead original schedule due to the upcoming 7.2-RELEASE)
  
   - Remove kH (kp_kll) from screen. It has the identical key sequence as
     @7 (kp_end). As ncurses has the limitation that it returns the first
     matched key symbol, you can not use END in ncurses based program under
     screen (like ports/misc/mc).
  
   We did similar changes to xterm entry last year for exactly the same reason.
  
   PR:           132199
   Submitted by: Timur I. Bakeyev <timur at FreeBSD.org>

Modified:
  stable/7/share/termcap/   (props changed)
  stable/7/share/termcap/termcap.src

Modified: stable/7/share/termcap/termcap.src
==============================================================================
--- stable/7/share/termcap/termcap.src	Tue Mar 17 14:17:59 2009	(r189929)
+++ stable/7/share/termcap/termcap.src	Tue Mar 17 14:29:25 2009	(r189930)
@@ -2771,7 +2771,7 @@ SC|screen|VT 100/ANSI X3.64 virtual term
 	: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~:@7=\E[4~:kP=\E[5~:\
+	:kh=\E[1~:kI=\E[2~:kD=\E[3~:@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:\
_______________________________________________
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"
Comment 5 Rong-En Fan freebsd_committer freebsd_triage 2009-03-17 14:30:39 UTC
State Changed
From-To: patched->closed

Committed to 7.x. Won't do 6.x as there is no more releases planned.