ANSI ESCape sequences

In those days where screen monitors did not yet exist but Teletypes, nobody was interested in controlling the cursor - because it did also not exist. Introduction monitors changed that case. The cursor could be moved on every place on screen.

The general ASCII character set (7 bit, range 0x00 up to 0x7F) defines the presentation of characters: Within the control characters the character ESCAPE (0x1b) does exist. Mostly this character was used as a lead-in for cursor settings. (But some manufacturers used special control characters for controlling the screen). In the beginning any manufacturer had his unique set of control sequences. With their VT models (Video Terminal) the company Digital Equipment Corporation (DEC) created a standard. Look here for a compilation of documents for the VT series. The control sequences are well documented in the VT100 User Guide.

When CP/M came on the market no standard was available. But MS-DOS already used the ANSI controls. Look here for an overview in the MS-DOS environment.
Owner of TURBO PASCAL know how voluminous the combination of control sequences is. The utility TINST.COM allows the installation of any terminal. Look here for a section out of nearly endless combinations.

When the Joyce came on the market it did not use the ANSI standard but control sequences for the Zenith Z19/Z29 terminal. Look here for an overview for this terminal.

Recognize the similarity of both pf the control sets.

When I started to connect to the world with my machine Joye and a MODEM, I used the terminal emulation part of the tool KERMIT. Those institutions I connected to did support the VT 100 terminal and I wrote an ANSI emulator for proper work with it. I implemented the sequences in the following way:

FunctionANSI sequenceJOCYE conversion
Cursor upESC [ Pn APn-mal ESC A
Cursor downESC [ Pn BPn-mal ESC B
Cursor rightESC [ Pn CPn-mal ESC C
Cursor leftESC [ Pn DPn-mal ESC D
Cursor settingESC [ P1;P2 HESC Y P1+31 P2+31
Erase screenESC [ Pn JESC J
Erase lineESC [ Pn KESC K
Set attributesESC [ P1;..;Pn m Px=0 ESC u ESC q
Px=4 ESC r
Px=7 ESC p
Later on I implemented an ANSI RSX with additional functions:
FunctionANSI sequenceJOCYE conversion
Cursor settingESC [ P1;P2 fESC Y P1+31 P2+31
Save cursor positionESC [ sESC j
Restore cursor positionESC [ uESC k

The exact conversion of the sequences ESC [ Pn J and ESC [ Pn K is missing to my implementation of KERMIT. Correctly the conversion must look as follows:

Correct functionen
Erase screen
FunctionANSI sequenceJOCYE conversion
From Cursor to endESC [ 0 JESC J - Default
From start to cursorESC [ 1 JESC d
Erase allESC [ 2 JESC E
Erase line
FunctionANSI sequenceJOCYE conversion
From Cursor to endESC [ 0 KESC K - Default
From start to cursorESC [ 1 KESC o
Erase allESC [ 2 KESC l

In the following implementation of the RSX this correction is considered.
Activated by the implementation of an ANSI RSX by Andress Freystatzky I modified it accordingly. The ANSI control program will be combined with the RSX by GENCOM; the control program allows activating and removing of this RSX.

Here an overview of the tools:

ANSI RSX ANSI control program KERMIT (part 10)