Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!ace.ee.lbl.gov!leres
From: leres@ace.ee.lbl.gov (Craig Leres)
Newsgroups: comp.windows.x
Subject: Re: insert character optimization for xterm termcap entry
Message-ID: <784@helios.ee.lbl.gov>
Date: 18 Aug 88 23:20:47 GMT
References: <777@helios.ee.lbl.gov> <9900@eddie.MIT.EDU>
Sender: usenet@helios.ee.lbl.gov
Reply-To: leres@helios.ee.lbl.gov (Craig Leres)
Organization: Lawrence Berkeley Laboratory, Berkeley
Lines: 24

Jeff Siegal writes:
> I would think that whether insert-mode should be preferred over insert
> character would depend on the application.

I claim that for the "Unix" application, insert mode is preferred. The
termcap(5) manual entry agrees with me:

    [...]            Most terminals with a true insert mode will
    not  give  ic,  terminals  which  send  a sequence to open a
    screen position  should  give  it  here.   (Insert  mode  is
    preferable  to the sequence to open a position on the screen
    if your terminal  has  both.)  [...]

If you use the insert character sequence, the overhead for each
inserted character is 3 characters per character. If you use insert
mode, the overhead is 4 characters to enter insert mode and 4
characters to leave insert mode. So when you insert more than 2
characters, it's cheaper to use insert mode. But this assumes that you
always exit insert mode immediately after an insertion; since xterm
allows movement while in insert mode, you can delay switch back to
replacement mode. In some cases, you'll move somewhere else and do
another insertion and save the 4 character end insert mode and 4
character enter insert mode sequences. Vi works this way.

		Craig