;;;====================================================================== ;;; Here is some info I have on vt200 escape sequences. I think they all ;;; work on vt100's also. ;;;====================================================================== ;;; ;;; Operation Command ;;; ================+================ ;;; Clear Screen ESC[2JESC[H ;;; Up N lines ESC[NA ; N is a variable ;;; Down N lines ESC[NB ; N is a variable ;;; Right N cols ESC[NC ; N is a variable ;;; Left N cols ESC[ND ; N is a variable ;;; Move cursor to ;;; line L, col C ESC[L;CH ; L, C are variables ;;; ;;; If anyone wants more details (bold, reverse video, underlining, graphics ;;; chars for drawing lines and corners, etc), send me mail and I'll bring my ;;; OLD vt220 "Pocket Guide" from which I got this info. You can probably glean ;;; it from /etc/termcap for other terminal types. ;;; ;;; Note that #\Escape is the character for ESC in Lisp; you ;;; can use (setf (aref ) #\Escape) to stick it in, or ;;; use (format nil ...) to construct the string. See two examples below, ;;; one doing it each way. ;;; 1995 Marty Hall. marty_hall@jhuapl.edu ;;;====================================================================== ;;;====================================================================== ;;; Defines a Clear-Screen function for vt100 terminals. ;;; Note that this does not work if running Lisp within emacs, only ;;; from a tty in vtxxx mode. You could put a real escape character in ;;; the file instead of sticking it in the string at run-time, but that ;;; would make it hard to view and print the source code. (defun Clear-Screen () "Clear the screen on a vt100 terminal. Don't use from within emacs." (let ((String " [2J [H")) (setf (aref String 0) #\Escape) ; Stick ESCAPE in for the spaces (setf (aref String 4) #\Escape) (princ String) ; PRINC doesn't do a CR (PRINT does) (values) )) ;;;====================================================================== ;;; Again, don't use this from within emacs. (defun Move-Up (Lines) "On a vt100 terminal, move cursor up the specified number of lines" (let ((String (format nil "~A[~DA" #\Escape Lines))) ; ie "ESC[3A" (format t String) (values))) ; Suppress output ;;;======================================================================