From 169e8dca0f40fba06310ac33fdde8db2e21b9362 Mon Sep 17 00:00:00 2001 From: kitty Date: Sun, 8 Mar 2026 20:20:44 +1100 Subject: at-xy and page --- jefs.fs | 7 +++++-- 1 file 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 {{{ -- cgit v1.2.3