ZTERM Escape Sequences

A-Shell emulates some of the more common ZTERM ESC sequences, as described below.

Note that most of the features provided by the ZTERM escape sequences are also available in A-Shell/Windows via a Tab(-10,x) sequence or a subroutine. The advantage of the Tab(-10,x) or XCALL method is that the same code will work under A-Shell/Windows and A-Shell/UNIX with ATE on the client. But the advantage of the ZTERM ESC sequences is that they would work on any server platform (i.e. one that you telnet to) provided the client is ZTERM or ATE. But in the latter case, you should test to make sure you aren't running locally on A-Shell/windows, where the ESC sequences would not make much sense.

ZTERM
Esc Seq

Tab(-10)
Command

XCALL Subroutine


Comment

27,27,3

 

 

Enable Serial Passthrough

27,27,4

 

 

Disable Serial Passthrough

27,12

24

MX_SHELLEX

Execute or print windows file ("shell execute")

27,22

23

HOSTEX

Execute Windows command ("win exec")

27,15

 

MX_GETIP

Get client IP address

27,1,127

22

 

FTP file transfer

27,13

1, 2

MX_TITLE

Label window

27, 25

27

MX_SHOW WINDOW

Set window state

27,16

28

 

Flash window

27,29

29

 

Set ftp login name/password

 

Many of the ZTERM ESC sequences use a CHR(0) (aka null byte) as a delimiter. However, if for some reason you have difficulty sending null bytes, you can use CHR(128) as an equivalent alternative.

Examples

 

Execute or print windows file ("shell execute")

?CHR(27) CHR(12);OP$;FSPEC$;CHR(0);

   (OP$ is "O" to "open" or "P" to "print)

INPUT A              ! CR for ok, Control-C for error

 

Execute windows command (aka "win exec")

?CHR(27);CHR(22);CMD$;CHR(0);

INPUT A               ! CR for ok, Control-C for error

 

Get client ip address

?CHR(27);CHR(15);

INPUT "",IP'ADDR$

 

ftp file transfer

?CHR(27);CHR(1);CHR(127);DIR$;HOSTDIR$;CHR(0); &

   HOSTFILE$;CHR(0);PCFILE$;CHR(0);

INPUT A

ATE supports transferring entire directories, in addition to single files, by setting the HOSTFILE$ or filename portion of PCFILE$ to “*”.

Label window

?CHR(27);CHR(13);TITLE$;CHR(0);

! sets title for both normal and minimized window

 

Set window state

?CHR(27);CHR(25);CMD$ !(CMD$ is M, X, R, or N)

 

Flash window

?CHR(27);CHR(16);"1"            ! start flashing

?CHR(27);CHR(16);"0"            ! stop flashing

 

Set ftp login name/password

?CHR(27);CHR(29);NAME$;CHR(0);PW$;CHR(0);