[comp.sys.ibm.pc] IBM-PC escape sequences

ken@aiai.ed.ac.uk (Ken Johnson) (02/12/90)

This is a summary of the information I've had; it is meant to be
helpful, but it is probably disappointing.

If your system has on it the file ANSI.SYS and CONFIG.SYS, and if
CONFIG.SYS contains the line

  DEVICE=ANSI.SYS

then the escape sequences available are the ANSI ones.  There are other
devices (NANSI.SYS and NNANSI.SYS) around, but I don't have copies of
either. The escape sequences available are those listed in the IBM DOS
manual:

esc[#;#H	Cursor position
esc[#A		Cursor up
esc[#B		Cursor down
esc[#C		Cursor forward
esc[#D		Cursor backward
esc[#;#f	Same as esc[#;#H (Cursor position)
esc[6n		Put device status report on stdin
esc[#;#R	Cursor position: written ONTO stdin by esc[6n
esc[s		Save cursor
esc[u		Restore cursor
esc[2j		Erase screen, cursor home
esc[K		Erase to end of line
esc[#;#..;#m	Set graphics rendition. Paramatrers are
			0	normal
			1	bold
			4	underscore
			5	blink
			7	reverse video
			8	invisible
			30...37	foreground colour
			40...47	background colour

esc[=#h		Set mode. Parameters are
			0	40x25 b&w
			1	40x25 colour
			2	80x25 b&w
			3	80x25 colour
			4	320x200 colour
			5	320x200 b&w
			6	640x200 b&w
			7	Wrap at end of line
esc[=#l		Reset mode. Pramaters as above except 7 clears wrap at
		end of line instead of setting it
esc[#;#;...#p	Key reassign. First parameter is the code being mapped;
		others are the new output from that key.

# throughout is a decimal number, possibly of more than one digit; if
  omitted, defaults to 1. 

-- 
Ken Johnson, AI Applications Institute, 80 South Bridge, Edinburgh EH1 1HN
E-mail ken@aiai.ed.ac.uk, phone 031-225 4464 extension 212
`I have read your article, Mr Johnson, and I am no wiser now than when I
started'.  -- `Possibly not, sir, but far better informed.'