-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvt100.4th
More file actions
40 lines (35 loc) · 912 Bytes
/
Copy pathvt100.4th
File metadata and controls
40 lines (35 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
\ VT100 escape command helpers
\ (c)copyright 2015-2016 by Gerald Wodni <gerald.wodni@gmail.com>
\ TODO : implement in 2 tables (color - no color), implement toggle switch
\ sequence helpers
: <esc> ( -- )
$1B emit ;
: <esc>-type ( c-addr n -- )
<esc> type ;
: <esc>[ ( c-addr n -- )
<esc> [CHAR] [ emit type ;
: <esc>[m ( c-addr n -- )
<esc>[ [CHAR] m emit ;
\ font
: vt-bold
s" 1m" <esc>[ ;
: vt-normal
s" [22m" <esc>-type ;
\ colors
: vt-color-off s" [39m" <esc>-type ;
: vt-white s" 37" <esc>[m ;
: vt-cyan s" 36" <esc>[m ;
: vt-magenta s" 35" <esc>[m ;
: vt-blue s" 34" <esc>[m ;
: vt-yellow s" 33" <esc>[m ;
: vt-green s" 32" <esc>[m ;
: vt-red s" 31" <esc>[m ;
\ backgrounds
: vt-bg-off s" 49m" <esc>[ ;
: vt-bg-white s" 47m" <esc>[ ;
: vt-bg-black s" 40m" <esc>[ ;
\ combined
: vt-default
vt-normal
vt-bg-off
vt-color-off ;