hammer - Add memory use limit option for dedup runs
[dragonfly.git] / sys / boot / forth / screen.4th
1 \ Screen manipulation related words.
2 \ $FreeBSD: src/sys/boot/forth/screen.4th,v 1.1 2003/05/30 09:29:23 scottl Exp $
3 \ $DragonFly: src/sys/boot/forth/screen.4th,v 1.1 2003/11/10 06:08:34 dillon Exp $
4
5 marker task-screen.4th
6
7 : escc  ( -- )  \ emit Esc-[
8         91 27 emit emit
9 ;
10
11 : ho    ( -- )  \ Home cursor
12         escc 72 emit    \ Esc-[H
13 ;
14
15 : cld   ( -- )  \ Clear from current position to end of display
16         escc 74 emit    \ Esc-[J
17 ;
18
19 : clear ( -- )  \ clear screen
20         ho cld
21 ;
22
23 : at-xy ( x y -- )      \ move cursor to x rows, y cols (1-based coords)
24         escc .# 59 emit .# 72 emit      \ Esc-[%d;%dH
25 ;
26
27 : fg    ( x -- )        \ Set foreground color
28         escc 3 .# .# 109 emit   \ Esc-[3%dm
29 ;
30
31 : bg    ( x -- )        \ Set background color
32         escc 4 .# .# 109 emit   \ Esc-[4%dm
33 ;
34
35 : me    ( -- )  \ Mode end (clear attributes)
36         escc 109 emit
37 ;