Subject: xsrc/10383: xterm always clears the screen when termcap-using programs exit
To: None <gnats-bugs@gnats.netbsd.org>
From: None <eramore@era-t.ericsson.se>
List: netbsd-bugs
Date: 06/16/2000 15:27:12
>Number:         10383
>Category:       xsrc
>Synopsis:       xterm always clears the screen when termcap-using programs exit
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    xsrc-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 16 15:28:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Michael Eriksson
>Release:        -current of about May 30, 2000; xsrc of June 13, 2000
>Organization:
Ericsson Radio Systems AB
>Environment:
System: NetBSD kafka 1.4Z NetBSD 1.4Z (KAFKA) #0: Wed May 31 23:43:12 CEST 2000 mer@kafka:/usr/src/sys/arch/i386/compile/KAFKA i386


>Description:

When using titeInhibit, xterm removes the ``ti'' and ``te''
capabilities from the termcap entry it exports in $TERMCAP. As the
xterm termcap entry is too long to fit in 1024 bytes, a ZZ capability
is used by NetBSD's new termcap code, and thus the $TERMCAP is ignored
at program startup. That is, all programs use the ``ti'' and ``te''
capabilities even if titeInhibit is set in xterm. As the ``te''
capability contains a clear screen sequence (and a restore cursor
sequence), the screen gets cleaned at each exit of termcap-using
programs such as emacs and top.

>How-To-Repeat:

Try to run top in an xterm with titeInhibit set, and watch it clear
the screen when top is exited.

>Fix:

Setting a $TERMCAP that doesn't match the real termcap entry is
obviously a hack, but titeInhibit is nice, so it would be a pity to
just remove it.

Some ideas:

1. Remove the clear screen ("\E[2J") and cursor restore ("\E8")
sequences from the ``te'' capability.

2. Let $TERMCAP point to a file which contains a termcap entry without
the ``ti'' and ``te'' capabilities.

3. Set $TERM to something else than "xterm", like "xterm-ti". This
isn't very nice when doing network logins to systems where this
terminal type isn't defined, though.

4. Make the xterm termcap entry fit in 1024 bytes :-)
>Release-Note:
>Audit-Trail:
>Unformatted: