Subject: lib/20209:
To: None <gnats-bugs@gnats.netbsd.org>
From: None <gschmidt@mit.edu>
List: netbsd-bugs
Date: 02/05/2003 00:50:26
>Number:         20209
>Category:       lib
>Synopsis:       
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 04 21:51:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Geoff Schmidt
>Release:        NetBSD 1.6
>Organization:
none
>Environment:
System: NetBSD megalixir 1.6 NetBSD 1.6 (GENERIC_LAPTOP) #0: Sun Sep 8 19:55:58 UTC 2002 autobuild@tgm.daemon.org:/autobuild/i386/OBJ/autobuild/src/sys/arch/i386/compile/GENERIC_LAPTOP i386
Architecture: i386
Machine: i386
>Description:
Inside an xterm, after drawing an inverse video line-drawing character,
curses sends the escape code ^]]m to return to normal video, non-
line-drawing mode, but xterm interprets this escape to cancel only
inverse video mode, leaving the terminal in line-drawing mode to the
dismay of the user.

This appears to reflect confusion about the meaning of the 'me' termcap
entry. curses sends this string as if it means 'cancel all attributes
including line-drawing mode', but xterm interprets the string given
in termcap to mean 'cancel visual attributes such as boldface and
inverse video, but do not exit line-drawing mode.' The manual page is
vague on the exact intended meaning of 'me'.

ncurses appears to share xterm's interpretation of 'me'.
>How-To-Repeat:

Install the 'screen' package. Start screen. Echo this sequence of
characters to draw an inverse video horizontal dash: 
   ^[)0^N^[[7mq^O^[[m
Switch to a new screen page and back by typing ^Ac^Ap. Observe
that your prompt has been replaced with line-drawing characters.
Type exit twice to exit screen and reset your terminal.
>Fix:
Any of the following will fix the problem, but it seems that exactly
one of them must be correct:
 1) Modify curses to send both 'me' and 'ae' to exit inverse video
    line-drawing mode, instead of just 'me.'
 2) Add a ^O to the end of xterm's 'me' termcap entry.
 3) Modify xterm to exit line-drawing mode on receipt of ^[[m.

I suspect that (1) is correct. Locally, I have implemented (2) as
a temporary workaround. Both (2) and (3) could surprise applications
that expect 'me' to leave the terminal in line-drawing mode, if in
fact any such applications exist.

Thanks!
>Release-Note:
>Audit-Trail:
>Unformatted:
 Curses apparently mishandles end of line drawing mode when other attributes present