🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by Frank I. Reiter Fri, 18 Dec 1992 00:41
VT100 scrolling region
#1350
Author: Frank I. Reiter
Date: Fri, 18 Dec 1992 00:41
20 lines
1296 bytes
Part of an application I am working on includes a VT100 emulator.  We thought
this was complete until today when one of our users began using it to telnet
into a VAX system where the default editor makes use of scrolling regions.

My understanding is that the code ESC [n1;n2r sets the scrolling region to
lines n1 through n2 inclusive, but there are two things I do not know:

1) Does ESC [;22r mean "scroll lines 0 through 22" or does it mean "Set the
bottom scrolling line to 22, leave the top line as it is set already" ?

2) Should a clear screen code clear the scrolling region only, or the entire
screen?  How about a clear to end of screen?

I will be ever so grateful if somebody could answer these questions for me.

Frank.
--
___________________________________________________________________
Frank I. Reiter                 Internet: Frank@mindlink.bc.ca
MIND LINK! Communications Corp. Surrey, British Columbia, Canada
Re: VT100 scrolling region
#1356
Author: Peter D. Smith
Date: Fri, 18 Dec 1992 16:36
23 lines
1255 bytes
In article <18623@mindlink.bc.ca>, Frank@mindlink.bc.ca (Frank I. Reiter) writes:
> Part of an application I am working on includes a VT100 emulator.  We thought
> this was complete...

Terminal emulators are always harder than they look.

> 1) Does ESC [;22r mean "scroll lines 0 through 22" or does it mean "Set the
> bottom scrolling line to 22, leave the top line as it is set already" ?

It should mean 'scroll lines 1 to 22'.  Remember that these sequences
could be implemented in TTL without a microprocessor of any kind & therefore
use the simplest possible implementation.  

> 
> 2) Should a clear screen code clear the scrolling region only, or the entire
> screen?  How about a clear to end of screen?
>

I think this is the whole screen regardless of the scrolling region.
Don't bet your company on it, though.


				Peter D. Smith
Re: VT100 scrolling region
#1313
Author: Jim Becker
Date: Mon, 21 Dec 1992 19:57
22 lines
1309 bytes
   Subject: pNN: VT100 scrolling region
   From: Frank@mindlink.bc.ca (Frank I. Reiter)
   Sender: news@deep.rsoft.bc.ca (Usenet)
   
   Part of an application I am working on includes a VT100 emulator.  We thought
   this was complete until today when one of our users began using it to telnet
   into a VAX system where the default editor makes use of scrolling regions.
   

having been down this path recently, i would highly recommend that you
get one of the DEC programming manuals explaining use of the scrolling
regions.  there are many "shortcuts" that applications make when using
scrolling regions that  will  break  a  non-robust  terminal  emulator
implementation.  you will end up doing a lot of tweaking for different
applications as they use this functionality in different, non-obvious,
ways. 

-jim

-- 
--
ANSI X3.64 sequences (was Re: VT100 scrolling region)
#1322
Author: Richard Shuford
Date: Tue, 29 Dec 1992 20:16
114 lines
5518 bytes
In article <lj3vgrINNieu@news.bbn.com> pdsmith@bbn.com (Peter D. Smith) writes:
> In article <18623@mindlink.bc.ca>, Frank@mindlink.bc.ca (Frank I. Reiter)
> writes:
> > Part of an application I am working on includes a VT100 emulator.
> > 1) Does ESC [;22r mean "scroll lines 0 through 22" or does it mean "Set
> > the bottom scrolling line to 22, leave the top line as it is set already"?
>
> It should mean 'scroll lines 1 to 22'.

The control sequences recognized by the Digital Equipment Corporation
VT100, VT200, VT300, and VT400-family character-cell video terminals
are an extended variant of the control sequences specified by an ANSI
standard, ANSI X3.64.  (ISO DP6429 is the international version.)

The generic sequence introducer is a thing called CSI (Control
Sequence Introducer).  If you are using 8-bit communication, you
can use the hexadecimal value 9B to represent this (but be sure you
understand the side effects thereof).  Otherwise, use the 7-bit
equivalent: the Escape character (1Bh) followed by [  (the left
bracket character).

The canonical form of the given scroll-region command would be  

    CSI xx ; yy r

or in 7-bit style

    Esc [ xx ; yy r

(where xx and yy are decimal digits expressed in ASCII/IA5; you do not
actually use a space between sequence elements, this is for clarity.
Be careful with the notation here--sometimes a space character _is_
a sequence element, as in the SR Scroll Right editing function.)

In an X3.64 control sequence, the numeric arguments may default to an
arbitrary value specific to the device function being controlled.  Do
not assume that the default always will be 0 or 1. (Or there may be
no default allowed.)  For example, the numeric arguments in the GSM
(Graphic Size Modify) sequence have the default values 100, 100.

As a private extension to X3.64, DEC defines the DECSTBM (Set Top and
Bottom Margins) command as follows:

        CSI Pt ; Pb r

    Selects top and bottom margins defining the scrolling region.
    Pt is the line number of the first line in the scrolling region.
    Pb is the line number of the bottom line.
    If you do not select either Pt or Pb, they default to the top
    and bottom respectively.  Lines are counted from 1.

(See \VT220 Programmer Pocket Guide/, part EK-VT220-HR-002, page 37.)

> Remember that these sequences
> could be implemented in TTL without a microprocessor of any
> kind & therefore use the simplest possible implementation.  

Peter must be thinking of the much simpler DEC VT52 sequences.  As far
as I know, terminals implementing X3.64 have ALWAYS used a built-in
microprocessor.  The VT100 was built around an 8-bit-bus Intel 8085.

In fact, when the X3.64 document was published (circa 1978), some
vendors, insisting on using discrete logic designs, objected that the
standard was so complex it could not be implemented.  Most of these
vendors are now floating belly-up on the tide of technology.  Some
credit is due to The Heath Company for a pioneering microprocessor-
based video terminal that implemented many of the X3.64 functions.

> > 2) Should a clear screen code clear the scrolling region only, or the
> >    entire screen?  How about a clear to end of screen?
>
> I think this is the whole screen regardless of the scrolling region.
> Don't bet your company on it, though.

Screen clearing should not depend on scrolling.

Erasing parts of the display (EL and ED) in the VT100 is performed thus:

     Erase from cursor to end of line           Esc [ 0 K    or Esc [ K
     Erase from beginning of line to cursor     Esc [ 1 K
     Erase line containing cursor               Esc [ 2 K
     Erase from cursor to end of screen         Esc [ 0 J    or Esc [ J
     Erase from beginning of screen to cursor   Esc [ 1 J
     Erase entire screen                        Esc [ 2 J

Some brain-damaged terminal/emulators respond to Esc [ J as if it were
Esc [ 2 J (here the default is 0), and _some_ versions of Microsoft's
MS-DOS ANSI.SYS contain a bug requiring software to send Esc [ k
(instead of the uppercase).  Of course, you would never make this mistake.

The VT200 and later terminals have the ECH control sequence:

  Esc yy X

(where yy is a numeric parameter)

This erases the cursor position and the next (yy-1) positions, but this
is not part of the least common denominator VT100.

 - - - - - -

There is still various video-terminal information available for
anonymous FTP in "pub/shuford" from

    CS.UTK.EDU  (128.169.201.1)

 - - - - - -

VT, Flip Chip, DIBOL, and Rainbow are trademarks of Digital Equipment
Corporation.
-- 
 ...Richard S. Shuford  | "A man's own folly ruins his life, yet
 ...shuford@cs.utk.edu  |  his heart rages against the Lord."
 ...Info-Stratus Coord. |  Proverbs 19:3  NIV
Re: ANSI X3.64 sequences (was Re: VT100 scrolling region)
#1468
Author: peter da silva
Date: Mon, 04 Jan 1993 22:39
22 lines
1602 bytes
In article <1hqbm7INN3c7@CS.UTK.EDU> shuford@cs.utk.edu (Richard Shuford) writes:
> In fact, when the X3.64 document was published (circa 1978), some
> vendors, insisting on using discrete logic designs, objected that the
> standard was so complex it could not be implemented.  Most of these
> vendors are now floating belly-up on the tide of technology.

Actually, the greatest objection was that these sequences were way too long,
and that a binary format would be much shorter leading to a lower overhead
design (even at 1200 baud, which was pretty good for some areas, the X3.64
output generated quite a lot of annoying pauses), plus (as noted) be easier
to implement.

(I thought a sequence based on the Lear Seigler cursor motion code would make
 more sense, myself)

All water under the bridge, just note that OSI isn't the first over-
engineered protocol out there...
-- 
Peter da Silva                                            `-_-'
Ferranti International Controls Corporation                'U` 
Sugar Land, TX  77487-5012 USA
+1 713 274 5180                            "Zure otsoa besarkatu al duzu gaur?"
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads