Clearing screen on petite chez scheme

728 views Asked by At

A little question that bothers me. Does anyone knows how to clear the screen on petite chez scheme SWL? I have tried clear, cls ,clean .

Thanks in advance.

1

There are 1 answers

6
soegaard On BEST ANSWER

This document http://scheme.com/csug8/use.html says:

^L-^L   clear screen and redisplay entry

If you want to clear the screen from a program send the "clear screen" code used by your terminal. In https://github.com/tonyg/racket-ansi/blob/master/ansi.rkt you see that the code sent is CSI "2J" where CSI stands for \033[

Here is how to do it from a program (tested in Petite in terminal on OS X).

(define ESC #\033)
(define CSI (list->string (list ESC #\[ )))
(define CLEAR (string-append CSI "2J"))
(display CLEAR)