Skip to content

Commit e0cec14

Browse files
committed
misc: Improvements
- Improved documentation - Savepos account for macOS default Terminal.app
1 parent 1c6babc commit e0cec14

File tree

7 files changed

+196
-70
lines changed

7 files changed

+196
-70
lines changed

Bakefile.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# shellcheck shell=bash
22

33
task.docs() {
4-
shdoc < './pkg/src/public/bash-term.sh' > './docs/api-term.md'
4+
shdoc < './pkg/src/public/bash-term.sh' > './docs/bash-term.md'
55
}

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ Use [Basalt](https://github.com/hyperupcall/basalt), a Bash package manager, to
1414
basalt add hyperupcall/bash-term
1515
```
1616

17+
## Awknowledgements
18+
19+
- Function docstring descriptions were taken from [justjavac/deno_ansi](https://github.com/justjavac/deno_ansi)
20+
1721
## References
1822

1923
- [vtasni.html](https://www2.ccs.neu.edu/research/gpc/VonaUtils/vona/terminal/vtansi.htm)
2024
- [asnci-escapes](https://github.com/sindresorhus/ansi-escapes/blob/main/index.js)
25+
- [ANSIcode.html](https://www.real-world-systems.com/docs/ANSIcode.html)

bake

Lines changed: 24 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api-term.md renamed to docs/bash-term.md

Lines changed: 76 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,209 @@
11
## Index
22

33
- [term.cursor_to()](#termcursor_to)
4+
- [term.cursor_moveto()](#termcursor_moveto)
45
- [term.cursor_up()](#termcursor_up)
56
- [term.cursor_down()](#termcursor_down)
67
- [term.cursor_forward()](#termcursor_forward)
78
- [term.cursor_backward()](#termcursor_backward)
89
- [term.cursor_line_next()](#termcursor_line_next)
910
- [term.cursor_line_prev()](#termcursor_line_prev)
10-
- [term.cursor_tocolumn()](#termcursor_tocolumn)
11+
- [term.cursor_horizontal()](#termcursor_horizontal)
1112
- [term.cursor_savepos()](#termcursor_savepos)
1213
- [term.cursor_restorepos()](#termcursor_restorepos)
1314
- [term.cursor_save()](#termcursor_save)
1415
- [term.cursor_restore()](#termcursor_restore)
1516
- [term.cursor_hide()](#termcursor_hide)
1617
- [term.cursor_show()](#termcursor_show)
17-
- [term.scroll_down()](#termscroll_down)
18-
- [term.scroll_up()](#termscroll_up)
19-
- [term.tab_set()](#termtab_set)
20-
- [term.tab_clear()](#termtab_clear)
21-
- [term.tab_clearall()](#termtab_clearall)
18+
- [term.cursor_getpos()](#termcursor_getpos)
2219
- [term.erase_line_end()](#termerase_line_end)
2320
- [term.erase_line_start()](#termerase_line_start)
2421
- [term.erase_line()](#termerase_line)
2522
- [term.erase_screen_end()](#termerase_screen_end)
2623
- [term.erase_screen_start()](#termerase_screen_start)
2724
- [term.erase_screen()](#termerase_screen)
2825
- [term.erase_saved_lines()](#termerase_saved_lines)
26+
- [term.scroll_down()](#termscroll_down)
27+
- [term.scroll_up()](#termscroll_up)
28+
- [term.tab_set()](#termtab_set)
29+
- [term.tab_clear()](#termtab_clear)
30+
- [term.tab_clearall()](#termtab_clearall)
2931
- [term.beep()](#termbeep)
3032
- [term.hyperlink()](#termhyperlink)
3133

3234
### term.cursor_to()
3335

36+
Move the cursor position to a supplied row and column. Both default to `0` if not supplied
37+
38+
#### Arguments
39+
40+
- **$1** (int): row
41+
- **$1** (int): column
42+
43+
### term.cursor_moveto()
44+
45+
Moves cursor position to a supplied _relative_ row and column. Both default to `0` if not supplied (FIXME: implement)
46+
3447
#### Arguments
3548

3649
- **$1** (int): row
3750
- **$1** (int): column
3851

3952
### term.cursor_up()
4053

54+
Moves the cursor up. Defaults to `1` if not supplied
55+
4156
#### Arguments
4257

4358
- **$1** (int): count
4459

4560
### term.cursor_down()
4661

62+
Moves the cursor down. Defaults to `1` if not supplied
63+
4764
#### Arguments
4865

4966
- **$1** (int): count
5067

5168
### term.cursor_forward()
5269

70+
Moves the cursor forward. Defaults to `1` if not supplied
71+
5372
#### Arguments
5473

5574
- **$1** (int): count
5675

5776
### term.cursor_backward()
5877

78+
Moves the cursor backwards. Defaults to `1` if not supplied
79+
5980
#### Arguments
6081

6182
- **$1** (int): count
6283

6384
### term.cursor_line_next()
6485

86+
Moves the cursor to the next line. Defaults to `1` if not supplied
87+
6588
#### Arguments
6689

6790
- **$1** (int): count
6891

6992
### term.cursor_line_prev()
7093

94+
Moves the cursor to the previous line. Defaults to `1` if not supplied
95+
7196
#### Arguments
7297

7398
- **$1** (int): count
7499

75-
### term.cursor_tocolumn()
100+
### term.cursor_horizontal()
101+
102+
Moves the cursor ?
76103

77104
#### Arguments
78105

79106
- **$1** (int): count
80107

81108
### term.cursor_savepos()
82109

110+
Saves the current cursor position
111+
83112
_Function has no arguments._
84113

85114
### term.cursor_restorepos()
86115

116+
Restores cursor to the last saved position
117+
87118
_Function has no arguments._
88119

89120
### term.cursor_save()
90121

122+
Saves
123+
91124
_Function has no arguments._
92125

93126
### term.cursor_restore()
94127

128+
Restores
129+
95130
_Function has no arguments._
96131

97132
### term.cursor_hide()
98133

134+
Hides the cursor
135+
99136
_Function has no arguments._
100137

101138
### term.cursor_show()
102139

140+
Shows the cursor
141+
103142
_Function has no arguments._
104143

105-
### term.scroll_down()
144+
### term.cursor_getpos()
145+
146+
Reports the cursor position to the application as (as though typed at the keyboard)
106147

107148
_Function has no arguments._
108149

109-
### term.scroll_up()
150+
### term.erase_line_end()
151+
152+
Erase from the current cursor position to the end of the current line
110153

111154
_Function has no arguments._
112155

113-
### term.tab_set()
156+
### term.erase_line_start()
157+
158+
Erase from the current cursor position to the start of the current line
114159

115160
_Function has no arguments._
116161

117-
### term.tab_clear()
162+
### term.erase_line()
163+
164+
Erase the entire current line
118165

119166
_Function has no arguments._
120167

121-
### term.tab_clearall()
168+
### term.erase_screen_end()
169+
170+
Erase the screen from the current line down to the bottom of the screen
122171

123172
_Function has no arguments._
124173

125-
### term.erase_line_end()
174+
### term.erase_screen_start()
175+
176+
Erase the screen from the current line up to the top of the screen
126177

127178
_Function has no arguments._
128179

129-
### term.erase_line_start()
180+
### term.erase_screen()
181+
182+
Erase the screen and move the cursor the top left position
130183

131184
_Function has no arguments._
132185

133-
### term.erase_line()
186+
### term.erase_saved_lines()
134187

135188
_Function has no arguments._
136189

137-
### term.erase_screen_end()
190+
### term.scroll_down()
138191

139192
_Function has no arguments._
140193

141-
### term.erase_screen_start()
194+
### term.scroll_up()
142195

143196
_Function has no arguments._
144197

145-
### term.erase_screen()
198+
### term.tab_set()
146199

147200
_Function has no arguments._
148201

149-
### term.erase_saved_lines()
202+
### term.tab_clear()
203+
204+
_Function has no arguments._
205+
206+
### term.tab_clearall()
150207

151208
_Function has no arguments._
152209

docs/btput.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

0 commit comments

Comments
 (0)