about summary refs log tree commit diff stats
path: root/readme
diff options
context:
space:
mode:
authorCase Duckworth2023-05-28 21:47:09 -0500
committerCase Duckworth2023-05-28 21:47:09 -0500
commit82a6e29eaad2944eb2e1a2213a9bce17e896add4 (patch)
treeebedbf6e65bb222d2ce76b491cccb51eca479d00 /readme
downloadyolk-82a6e29eaad2944eb2e1a2213a9bce17e896add4.tar.gz
yolk-82a6e29eaad2944eb2e1a2213a9bce17e896add4.zip
initial commit
Diffstat (limited to 'readme')
-rw-r--r--readme136
1 files changed, 136 insertions, 0 deletions
diff --git a/readme b/readme new file mode 100644 index 0000000..a98c60b --- /dev/null +++ b/readme
@@ -0,0 +1,136 @@
1YOLK --- ansi escapes for CHICKEN -*- text -*-
2
3yes there's already ansi-escape-sequences[1]. consider this NIH ;)
4this library is based on the information a gist by fnky[2].
5at some point i should base it instead on xterm's manual[3].
6
7Unless otherwise stated, all procedures and variables in this library are
8strings or return strings ready for `display'.
9
10INSTALLATION.
11
12Run `chicken-install' in this directory or `make install', which will run it for you. You can also run `make clean' to clean the folder of build artifacts.
13
14MODULES.
15
16(yolk common) --- common functionality
17
18Procedures.
19
20- (esc . xs)
21
22Return a string consisting of XS, converted to strings, prepended by ESC.
23
24- (csi . xs)
25
26Convenience function to escape XS using the csi code (ESC "[").
27
28- (dcs . xs)
29
30Convenience function to escape XS using the dcs code (ESC "P").
31
32- (ocs . xs)
33
34Convenience function to escape XS using the ocs code (ESC "]").
35
36- (parameter-assert predicate error-message)
37
38Convenience function. Returns a function that runs PREDICATE on its argument and
39returns the argument if PREDICATE passes, or errors if not. I use this for
40parameters.
41
42Syntax.
43
44- (define-esc-alt-wrapper wrapper-proc-name param-name (default-proc args ...))
45
46Many terminal behaviors have multiple escape sequences that might work. This
47macro defines a parameter named PARAM-NAME and a procedure named
48WRAPPER-PROC-NAME that will call PARAM-NAME with ARGS ... . The user can change
49which procedure to call by calling (PARAM-NAME new-proc).
50
51(yolk colors) --- NOT FINISHED
52
53There's a bug in this library.
54
55(yolk cursor) --- cursor movement
56
57Variables.
58
59-- cursor-home
60
61Move the cursor to the top-left corner (0,0). NOTE: This and the move commands
62might be revised later.
63
64Procedures.
65
66-- (cursor-move x y)
67
68Move cursor to X, Y, counting from the top-left corner of the screen.
69cursor-move is an esc-alt-wrapper that defaults to cursor-move/H ("^[[Y;XH").
70
71-- (cursor-up n)
72-- (cursor-down n)
73-- (cursor-right n)
74-- (cursor-left n)
75
76Move cursor up, down, left, or right by N spaces.
77
78-- (cursor-up-bol n)
79-- (cursor-down-bol n)
80
81Move cursor up or down by N lines, to the beginning of the given line.
82
83-- (cursor-move-column n)
84
85Move cursor to column N.
86
87-- (cursor-save)
88-- (cursor-restore)
89
90Save or restore the cursor's position on the screen. These variables are
91parameters defaulting to the DEC escapes. You can set them to the SCO escapes
92using (cursor-save cursor-save/sco), for example.
93
94(yolk erase) --- erasing the screen
95
96Variables.
97
98-- erase-screen-down
99-- erase-screen-up
100-- erase-screen
101-- erase-saved-lines
102
103These erase portions of the entire screen.
104
105-- erase-line-right
106-- erase-line-left
107-- erase-line
108
109These erase portions of the current line.
110
111-- erase-line-and-return
112
113Convenience function to return the cursor to the beginning of the line after erasing it.
114
115(yolk xterm) --- xterm-specific escape sequences
116
117Variables.
118
119-- invisible-cursor
120-- visible-cursor
121
122Make the cursor invisible or visible.
123
124-- save-screen
125-- restore-screen
126
127Save or restore the screen's state.
128
129-- alt-buffer-enable
130-- alt-buffer-disable
131
132Enable or disable the "alternate buffer."
133
134[1]: http://wiki.call-cc.org/eggref/5/ansi-escape-sequences
135[2]: https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797
136[3]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html