[comp.unix.questions] split screen on VT220

ssi@usfvax2.EDU (Ssi) (04/29/89)

 I'm trying to get a simple split screen utility working on a VT220
running in VT100 mode. I've created a termcap entry for the
top half and bottom half of the screen to set scroll region,
number of lines etc.
 I have an alias to envoke the termcap entry and move the cursor.
The problem is that `vi' clears to bottom of screen when it
has to scroll the top `window' up, and in the bottom `window'
when I try to cursor up past line one of the file the cursor
jumps to the top of screen, not to line 13 where the origin mode
(DECOM) is set??
 How do I convince `vi' that my terminal only has 12 lines?
For now all I want is for the window not in use to remain
intact while work goes on in the active window.
 The next step is side-by-side windows.
Anyone have any ideas on multiple shells running in separate
areas of the screen ?

                   Greg Ripp (813)628-6100 x5123
                   ...!uunet!pdn!usfvax2!system1!greg

milne@ics.uci.edu (Alastair Milne) (05/12/89)

ssi@usfvax2.EDU (Ssi) writes
> I'm trying to get a simple split screen utility working on a VT220
>running in VT100 mode. I've created a termcap entry for the
>top half and bottom half of the screen to set scroll region,
>number of lines etc.
> I have an alias to envoke the termcap entry and move the cursor.
>The problem is that `vi' clears to bottom of screen when it
>has to scroll the top `window' up, and in the bottom `window'
>when I try to cursor up past line one of the file the cursor
>jumps to the top of screen, not to line 13 where the origin mode
>(DECOM) is set??

    I can think of 2 things:
    - remove the "cl" capacity from your termcaps, so "vi" is forced to 
      clear the screen by a more explicit method, hopefully line by line.  
      (Other possibility: I seem to recall that the VT100 has separate 
      sequences for "clear from beginning of screen to cursor" and for "clear
      from cursor to end of screen".  If so, you could just include in the
      "cl" sequence for each termcap the "cm" sequence to move to the
      respective end of the window, and then the right clearing sequence.)
    - You may also need to add into your "cm" entry for the bottom window the
      offset to the top of the bottom window (likewise for its scrolling
      region capabilities and anything else that specifies a row number, or vi
      will wind up resetting them at the top of the screen when it's finished
      with them).
      (It would be easier if you could specify a top line for the screen, but
      I've never seen a termcap field for doing that.)


    Hope this helps,

    Alastair Milne