[comp.sys.hp] Need help figuring out a few HP terminal escape sequences

was@hp-lsd.COS.HP.COM (Bill Stubblebine) (05/21/90)

taylor@limbo.Intuitive.Com (Dave Taylor):

> I need to know what the following escape sequences do on an HP terminal
> (and "hpterm" too, btw).  Please note that the spaces between the
> characters are there simply for clarity and are not part of the actual
> sequences:

>       ESC R           I believe this does "end insert mode"
>       ESC &a-1 R
>       ESC cd

Here's an answer to the 2392A side of the question, direct from the
2392A manual (and terminal) in my study at home:

Reference:

        "HP 2392A Display Terminal/HP 2394A Data Entry Terminal"
        HP Part Number 02394-90001
        Copyright, 1985, Hewlett Packard Roseville Terminals Division

Appendix A - Escape Codes

ESC &a-1 R
        Cursor Control Operations:

        ESC & a +/-<col> c +/-<row> R

                " Moves the cursor by columns "col" and rows "row"
                 relative to its present cursor position in memory.
                 ("col" and "row" are signed integers).  A positive
                 number indicates right or downward movement and a
                 negative number indicates left or upward movement.

        As explained in the following excerpt from "Cursor Relative
        Addressing", Chapter 4, page 4-11, the terminal accepts
        several variations of the relative positioning command.

        "You can specify the location of any character within display
         memory by supplying row and column coordinates that are
         relative to the current cursor position.  (Note that the row
         coordinate is ignored when memory lock mode is on).  To move
         the cursor to another character position using cursor
         relative addressing, use any of the following escape
         sequences:

                ESC & a +/-<column number> c +/-<row number> R
             or ESC & a +/-<row number> r +/-<column number> C
             or ESC & a +/-<column number> C
             or ESC & a +/-<row number> R 

ESC cd
        This one is interesting.  Appendix A says ESC c locks the
        keyboard.  I sent the sequence ESC cd to my 2392A and the
        predictable response occurred:  keyboard locked, and a "d" was
        printed on the screen.


> The end result of this is that if one outputs this sequence of three
> commands followed by a regular "gets()" call, one can easily allow the
> user to use local cursor movement keys to shift to any line on the
> screen and use <RETURN> to have *that line* (from the beginning of the
> line, rather than from the cursor to the end) read into the buffer.

The response to the entire 3-command sequence was rather uninteresting
on my 2392A.  When I sent ^[R^[&a-1R^[cd to my terminal, the cursor
moved up one line, a 'd' was printed, and the keyboard was left
locked, from which only the only recovery was shift-reset.  Did you
transcribe all the commands correctly?

                                Bill Stubblebine
                                Hewlett-Packard Logic Systems Div.
                                8245 N. Union Blvd.
                                Colorado Springs, CO  80920
                                was@hp-lsd.hp.com  (Internet)
                                (719) 590-5568