diff options
-rw-r--r-- | world/tty-commands.scm | 6 | ||||
-rw-r--r-- | world/tty-commands.sld | 2 | ||||
-rw-r--r-- | world/ui.scm | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/world/tty-commands.scm b/world/tty-commands.scm index 4ce4212..880bbdb 100644 --- a/world/tty-commands.scm +++ b/world/tty-commands.scm @@ -25,6 +25,12 @@ number respectively. In ttys, cursor starts at 1,1" (csi-command! (number->string (+ y 1)) ";" (number->string (+ 1 x)) "H")) +(define (hide-cursor!) + (csi-command! "?25l")) + +(define (show-cursor!) + (csi-command! "?25h")) + (define (tui-initialize!) (enable-alternate-buffer!) (move-cursor! 0 0)) diff --git a/world/tty-commands.sld b/world/tty-commands.sld index 1ec5588..53fce0d 100644 --- a/world/tty-commands.sld +++ b/world/tty-commands.sld @@ -3,5 +3,7 @@ (export tui-initialize! tui-deinitialize! move-cursor! + hide-cursor! + show-cursor! erase-screen!) (include "tty-commands.scm")) diff --git a/world/ui.scm b/world/ui.scm index 73bfcc8..3b94616 100644 --- a/world/ui.scm +++ b/world/ui.scm @@ -21,6 +21,7 @@ (define (redisplay! table) ; TODO: This is currently utter slow! "I need to remove the arguments from it... Probably call-with-window later" + (hide-cursor!) (erase-screen!) (for-each (lambda (line-number) @@ -31,7 +32,8 @@ (write-char #\~)) ((string? line) (write-string line))))) - (iota (car terminal-size)))) + (iota (car terminal-size))) + (show-cursor!)) (define (tui-loop) (define table (make-piece-table "hola\nhola")) |