9

Such as cls for cmd.exe. It's very annoy if I can't do this.

Thomson
  • 20,586
  • 28
  • 90
  • 134

7 Answers7

12

You can use screen:clear-window to do this:

(screen:with-window (screen:clear-window screen:*window*))

For more information see the documentation on screen. Also note that these functions are specific to clisp.

mihai
  • 4,592
  • 3
  • 29
  • 42
sepp2k
  • 363,768
  • 54
  • 674
  • 675
5

That didn't work for me but this did (acquired from the link)

(screen:clear-window (screen:make-window))
slm
  • 15,396
  • 12
  • 109
  • 124
Rob
  • 51
  • 1
  • 1
5

if you are running clisp inside emacs

C-c M-o

which of course is

Control-C Alt-o  -or-
Control-C Meta-o

this is the default keybinding to call "clear buffer" from the "repl" menu.

miercoledi
  • 276
  • 2
  • 5
  • 1
    That is not an appropriate answer because it does not programmatically clear the screen from within the lisp/clisp code. –  Feb 15 '20 at 11:18
5

Depending on what terminal you're using(support for ANSI control sequences, for example on most *nix), you could try:

(defun cls()
  (format t "~A[H~@*~A[J" #\escape))

Then call it:

(cls)
automaton
  • 1,091
  • 1
  • 9
  • 23
1

CLISP UNDER WINDOWS

(ext:run-shell-command "cls")

(defun cls () (ext:run-shell-command "cls") )

then write in the repl

(cls) and voila

Sai
  • 19
  • 1
-2

(loop for x from 1 to 1400 do (princ " ")
)

-3

Nilambar this is for clisp 2.49 running under windows

When you are learning like me make a lot of test, try, error, abort etc and screen of repl or interpreter its a pigsty of that trys and its difficult to beginer to found the results to new trys then you type (ext:run-shell-comand "cls") and the repl clean it screen and the prompt go to upper left corner.

Sai
  • 1
  • 1
    Hello Sai. You are answering the comment in another answer. Please edit your first answer or use the answer comments to give more information. – Diego Malone Jun 03 '19 at 23:13