diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-22 20:11:11 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-22 20:17:52 +0100 |
commit | d46183860c1f3f10095e95023adcb79b1896ab0e (patch) | |
tree | dd331a0efe9777bfe84160139da1e39df3226b71 /terminal/escape.scm | |
parent | Add stuff to test.scm. (diff) | |
download | calp-d46183860c1f3f10095e95023adcb79b1896ab0e.tar.gz calp-d46183860c1f3f10095e95023adcb79b1896ab0e.tar.xz |
Move C and Scheme code into subdirs.
Diffstat (limited to 'terminal/escape.scm')
-rw-r--r-- | terminal/escape.scm | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/terminal/escape.scm b/terminal/escape.scm deleted file mode 100644 index 8f1b0c2b..00000000 --- a/terminal/escape.scm +++ /dev/null @@ -1,28 +0,0 @@ -;;; Module for terminal (ANSI) escape codes. - -(define-module (terminal escape) - #:use-module (srfi srfi-60) - #:use-module (terminal termios) - #:export (with-vulgar)) - -(define-public (cls) - (display "\x1b[H") ; Move cursor to the origin - (display "\x1b[J") ; Clear everything after cursor - ) - -;;; I don't curse, I'm just vulgar. - -(define-syntax with-vulgar - (syntax-rules () - ((_ thunk) - (let ((ifd (fileno (current-input-port))) - (ofd (fileno (current-output-port)))) - (dynamic-wind - (lambda () - (let ((bits (bitwise-ior ECHO ICANON))) - (c-lflags-disable! ifd bits) - (c-lflags-disable! ofd bits))) - thunk - (lambda () - (c-lflag-restore! ifd) - (c-lflag-restore! ofd)))) ))) |