Handle process and terminal correctly.

This commit is contained in:
Dominik Pantůček 2023-04-04 14:41:13 +02:00
parent 74afca1354
commit 2232786316
3 changed files with 14 additions and 5 deletions

View file

@ -39,6 +39,7 @@
ansi-string-length
ansi-paragraph-format
ansi-string
clrscr
ansi-tests!
)
@ -211,6 +212,11 @@
(cons arg res)
(cons arg (cons (apply ansi (reverse kws)) res))))))))))
;; Clears the entire screen and positions cursor in the upper-left
;; corner.
(define (clrscr)
(display "\x1b[0m\x1b[2J\x1b[0;0H"))
;; Performs ANSI module self-tests.
(define (ansi-tests!)
(run-tests