summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkitty <nepeta@canaglie.net>2026-03-08 20:20:44 +1100
committerkitty <nepeta@canaglie.net>2026-03-08 20:20:44 +1100
commit169e8dca0f40fba06310ac33fdde8db2e21b9362 (patch)
treed745295c70c472146f7ce38c9de67a5287b17b3c
parent2bf0d651a66c94139b320487398010277d1a510a (diff)
at-xy and page
-rw-r--r--jefs.fs7
1 files changed, 5 insertions, 2 deletions
diff --git a/jefs.fs b/jefs.fs
index b36d9e3..b990e0c 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -377,11 +377,11 @@ termios TCGETS stdin ioctl ( noname ) swap execute value tty
\ emits are relatively slow (one syscall per char: not good)
: ESC 27 emit ;
-: CSI ESC [ char [ ] literal emit ;
+: CSI ESC ." [" ;
\ each change uses a different one, which is not too efficient
\ Pm sequences allow multiple with ;
-: CSIm ( n -- ) CSI (.) say [ char m ] literal emit ;
+: CSIm ( n -- ) CSI (.) say ." m" ;
: foreground 30 + CSIm ;
: background 40 + CSIm ;
@@ -391,6 +391,9 @@ termios TCGETS stdin ioctl ( noname ) swap execute value tty
6 constant cyan 7 constant white 9 constant default
: bold 1 CSIm ; : normal 0 CSIm ;
+
+: at-xy ( x y -- ) CSI 1+ (.) say ." ;" 1+ (.) say ." H" ;
+: page CSI ." 2J" 0 0 at-xy ;
\ }}}
\ DUMP {{{