From:	SMTP%"RELAY-INFO-VAX@CRVAX.SRI.COM"  8-JUL-1993 13:55:16.62
To:	EVERHART
CC:	
Subj:	Re: reset of vt420

From: webosk@itwol.bhp.com.au (Ken Bosward)
X-Newsgroups: comp.os.vms
Subject: Re: reset of vt420
Message-Id: <1993Jul8.095808.933@iwsd01.itwol.bhp.com.au>
Date: 8 Jul 93 09:58:08 +1000
Organization: BHP Information Technology
Lines: 77
To: Info-VAX@kl.sri.com
X-Gateway-Source-Info: USENET

In article <01H088ODLB768ZDWH6@dlu.edu>, Joe Trimble <JOE@dlu.edu> writes:
>I use a VT420 terminal with several sessions (not "multi-sessions").
>When I have the lse editor on one session or the debugger it
>can disrupt other sessions when I move to them.
>For example, the delete key works but appears to split letters,
>or text scrolls in a section (and not the whole) of the display.
>
>To solve this problem, I either use reset session in setup or
>do set term/inquire.
>
>Is there a quicker method?

The reason for the split letters when using the delete key is because
the editor sets your terminal to "insert mode" when the cursor is
anywhere before the end of a line. Normally, your editor is in "replace
mode". I have two solutions:

1. I normally use the editor as a "kept" editor. That is, I spawn a
   subprocess to run the editor. When I want to switch sessions, I first
   return to my parent process using the LSE ATTACH command (I have
   defined GOLD-A to do this). LSE resets all terminal settings before
   returning to the parent process, so there is no problem switching to
   another session. To return to LSE, I hit a key which invokes a
   command procedure which searches for the subprocess running the LSE
   image and then attaches to that subprocess. By the way, attaching to
   a kept editor is *much* quicker than activating the editor.

2. I have defined the DCL symbol RESET as a command which resets all the
   terminal settings to the way I want them. If I do happen to switch
   sessions directly from the editor (or the debugger, or anything else
   that fiddles with terminal settings), I simply type RESET at the DCL
   prompt and everything is fine. Below is the command procedure I use
   to define the RESET symbol.

$------------------------cut here---------------------------------------
$! Define RESET symbol to reset terminal settings
$ SI[0,8] = 15
$ ESC[0,8] = 27
$ if f$getdvi("SYS$OUTPUT", "TT_DECCRT2")
$ then
$   CSI[0,8] = 155
$ else
$   CSI = ESC+"["
$ endif
$!
$ reset == "write sys$output """ -
         + "''CSI'm" -      ! Clear highlighting attributes
         + "''ESC'=" -      ! Set application keypad
         + "''CSI'?25h" -   ! Turn on text cursor
         + "''CSI'?4l" -    ! Set jump scroll
         + "''CSI'4l" -     ! Set replace mode
         + "''ESC'7" -      ! Save cursor pos. before resetting scroll region
         + "''CSI';24r" -   ! Set full screen scroll region
         + "''ESC'8" -      ! Restore cursor pos.
         + "''ESC'(B" -     ! Designate G0 as ASCII set
         + "''ESC')0" -     ! Designate G1 as DEC Graphics set
         + "''SI'"          ! Invoke G0 into GL
$!
$ if f$getdvi("SYS$OUTPUT", "TT_DECCRT2") then -
  reset == reset -
         + "''ESC'*<" -     ! Designate G2 as DEC Supplemental set
         + "''ESC'}"        ! Invoke G2 into GR
$!
$ reset == reset + """"
$ exit
$!----------------------------------------------------------------------

You can see from the above that to stop letter "splitting" when you
press the delete key, you need to write the sequence CSI+"4l" to the
terminal. You may want to add some other control sequences to the RESET
symbol. For example, I have a VT241, so I have added the ReGIS codes to
reset the colour the way I like it.

Hope this helps.
-- 
Ken Bosward, BHP Information Technology, Wollongong. Australia.
E-mail: webosk@itwol.bhp.com.au

