[comp.windows.x] disabling xterm alternate screen mode

mcqueen@acf3.NYU.EDU (David McQueen) (06/18/91)

Please forgive me if this is a frequently asked question, but I have been
using X-Windows for only a relatively short time and have not been a regular
reader of this group. My question regards the behavior of xterm as implemented
on the Stardent (Stellar) GS-2000, running X Version 11, Release 3.

As I understand the documentation, the xterm default behavior is to emulate
a VT102 terminal. In particular, xterm uses an 'alternate screen' when starting
up vi, so that upon exiting from vi the user sees the screen as it was before
starting vi. I find this disconcerting and would like to disable this feature,
if possible. The documentation seems to indicate that invoking xterm via:

xterm -xrm 'xterm*TiteInhibit: true' &

from another xterm (for example, the console window) should start an xterm with
alternate screen use disabled, but in fact it does not. My question is: should
the above invocation of xterm do what I want? If not, what (if anything) should
I do instead?

--David McQueen, Courant Institute, New York University
  mcqueen@acf3.nyu.edu
  mcqueen@mcqueen.cims.nyu.edu

swick@athena.mit.EDU (Ralph Swick) (06/18/91)

    what (if anything) should
    I do instead?

You should tell your vi not to use alternate screen mode, since
presumably you don't want this on any other terminal emulator
or real terminal either.  This is done by modifying your termcap
entry or environment variable.

mcqueen@acf3.NYU.EDU (David McQueen) (06/19/91)

In a previous posting I asked:

> As I understand the documentation, the xterm default behavior is to emulate
> a VT102 terminal. In particular, xterm uses an 'alternate screen' when
> starting up vi, so that upon exiting from vi the user sees the screen as it
> was before starting vi. I find this disconcerting and would like to disable
> this feature, if possible. The documentation seems to indicate that invoking
> xterm via:
> 
> xterm -xrm 'xterm*TiteInhibit: true' &
> 
> from another xterm (for example, the console window) should start an xterm
> with alternate screen use disabled, but in fact it does not. My question is:
> should the above invocation of xterm do what I want? If not, what (if
> anything) should I do instead?
> 

I have received several email messages pointing out that the above invocation
only does what I want on systems which employ termcap entries; systems which
employ terminfo entries are oblivious. My solution is to create my own
terminfo entries for xterm and xterms with the smcup and rmcup capabilities
deleted. (This requires using infocmp, vi and tic to create the modified
terminfo files and requires setting the TERMINFO environment variable so that
those files can be found.) This appears to work just fine.

Thanks to everyone who helped with this:

dce@smsc.sony.com (David Elliott) 
thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen)
swick@ATHENA.MIT.EDU (Ralph Swick)
tpw@mtgzy.att.com (T. P. Walsh)

--Dave McQueen
  mcqueen@acf3.nyu.edu
  mcqueen@mcqueen.cims.nyu.edu