-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathansiterm.coffee
42 lines (42 loc) · 1.14 KB
/
ansiterm.coffee
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
41
42
module.exports =
color: (color=0) -> "\x1b[#{color}m"
#color: -> ""
position: (row=1, column=1) -> "\x1b[#{row};#{column}H"
doublewide: -> "\x1b#6"
up: (rows='') -> "\x1b[#{rows}A"
down: (rows='') -> "\x1b[#{rows}B"
right: (columns='') -> "\x1b[#{columns}C"
left: (columns='') -> "\x1b[#{columns}D"
eraseLine: (part=0) -> "\x1b[#{part}K" # 0:right, 1:left, 2:all
eraseDisplay: (part=0) -> "\x1b[#{part}J" # 0:below, 1:above, 2: all
charset: (set='1') -> "\x1b(#{set}"
fg:
reset: 0
black: 30
red: 31
white: 37
grey: '38;5;7'
light_grey: '38;5;15'
grey44: '38;5;238'
bg:
reset: 0
black: 40
red: '48;5;9'
green: 42
yellow: 43
blue: '48;5;12'
magenta: '48;5;13'
cyan: 46
white: '48;5;15'
yellow: '48;5;11'
orange: '48;5;214'
cyan: 46
dark_red: 41
pink: '48;5;218'
dark_magenta: '48;5;5'
grey: 47
light_green: '48;5;10'
tan: '48;5;136'
dark_blue: '48;5;4'
slate: '48;5;74'
hot_pink: '48;5;212'