home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dove!cme!kramer
- From: kramer@cme.nist.gov (Tom Kramer)
- Newsgroups: comp.lang.lisp
- Subject: Re: How to send out ANSI code ?
- Summary: example LISP code for sending out ANSI code
- Message-ID: <20468@cosmos.cme.nist.gov>
- Date: 23 Dec 92 14:14:50 GMT
- References: <1992Dec17.113424.7819@debbie.cc.nctu.edu.tw>
- Organization: National Institute of Standards & Technology, Gaithersburg, MD
- Lines: 39
-
- In article <1992Dec17.113424.7819@debbie.cc.nctu.edu.tw>, GHOST@cc.nctu.edu.tw (Michael Huang) writes:
- >
- >
- >
- >
- > When I want to use the ANSI code to control the terminal position,
- > I tried the following program
- >
- > (prog () (code-char 27) (princ "[5,5H"))
- >
- > The result is that
- >
- > #\Esc
- > [5,5H
- >
- > How to send out the ANSI code ?
-
- Here are two examples of functions I use to send out ANSI code. The first
- one hides the window I am using. The second one resizes it. Both work
- from Allegro Common LISP running on a SUN3 or SUN4 with the Sunview
- window system. I do not know if they will work in other situations.
-
- (defun window-hide (portname)
- (princ (concatenate 'string (princ-to-string (code-char 27)) "[6t") portname)
- (finish-output portname))
-
- (defun window-resize (portname corner_x corner_y x_size y_size)
- (princ (concatenate 'string (princ-to-string (code-char 27))
- "[4;" (princ-to-string y_size) ";"
- (princ-to-string x_size) "t") portname)
- (princ (concatenate 'string (princ-to-string (code-char 27))
- "[3;" (princ-to-string corner_y) ";"
- (princ-to-string corner_x) "t") portname)
- (finish-output portname))
-
- Something similar should work for sending other ANSI codes.
-
- Tom Kramer
- kramer@cme.nist.gov
-