screen.4th revision 115410
1115410Sscottl\ Screen manipulation related words. 2115410Sscottl\ $FreeBSD: head/sys/boot/forth/screen.4th 115410 2003-05-30 09:29:24Z scottl $ 3115410Sscottl 4115410Sscottlmarker task-screen.4th 5115410Sscottl 6115410Sscottl: escc ( -- ) \ emit Esc-[ 7115410Sscottl 91 27 emit emit 8115410Sscottl; 9115410Sscottl 10115410Sscottl: ho ( -- ) \ Home cursor 11115410Sscottl escc 72 emit \ Esc-[H 12115410Sscottl; 13115410Sscottl 14115410Sscottl: cld ( -- ) \ Clear from current position to end of display 15115410Sscottl escc 74 emit \ Esc-[J 16115410Sscottl; 17115410Sscottl 18115410Sscottl: clear ( -- ) \ clear screen 19115410Sscottl ho cld 20115410Sscottl; 21115410Sscottl 22115410Sscottl: at-xy ( x y -- ) \ move cursor to x rows, y cols (1-based coords) 23115410Sscottl escc .# 59 emit .# 72 emit \ Esc-[%d;%dH 24115410Sscottl; 25115410Sscottl 26115410Sscottl: fg ( x -- ) \ Set foreground color 27115410Sscottl escc 3 .# .# 109 emit \ Esc-[3%dm 28115410Sscottl; 29115410Sscottl 30115410Sscottl: bg ( x -- ) \ Set background color 31115410Sscottl escc 4 .# .# 109 emit \ Esc-[4%dm 32115410Sscottl; 33115410Sscottl 34115410Sscottl: me ( -- ) \ Mode end (clear attributes) 35115410Sscottl escc 109 emit 36115410Sscottl; 37