https://github.com/mna/zzcsi
Control Sequence Introducer (CSI) functions for xterm-compatible terminals. (mirror)
https://github.com/mna/zzcsi
mirror terminal
Last synced: 2 months ago
JSON representation
Control Sequence Introducer (CSI) functions for xterm-compatible terminals. (mirror)
- Host: GitHub
- URL: https://github.com/mna/zzcsi
- Owner: mna
- License: bsd-3-clause
- Created: 2020-04-03T20:08:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-03T20:08:50.000Z (over 6 years ago)
- Last Synced: 2025-03-17T00:41:29.213Z (over 1 year ago)
- Topics: mirror, terminal
- Language: Go
- Size: 17.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zzcsi [](https://builds.sr.ht/~mna/zzcsi?) [](http://godoc.org/git.sr.ht/~mna/zzcsi) [](https://pkg.go.dev/git.sr.ht/~mna/zzcsi)
* Canonical repository: https://git.sr.ht/~mna/zzcsi
* Issues: https://todo.sr.ht/~mna/zzcsi
* Builds: https://builds.sr.ht/~mna/zzcsi
Package zzcsi implements the Control Sequence Introducer (CSI) functions
supported by Xterm-compatible terminals. The most commonly used functions are
to erase a line or the screen, manipulate the cursor or set the display
attributes such as foreground and background colors, bold or italics, but many
more functions are available. See the [xterm documentation][xterm] for more
information on CSI sequences.
See the [package documentation][godoc] for details, API reference and usage
example (alternatively, on [pkg.go.dev][pgd]).
This is a package in the [zzterm][zzt] family of Go packages, which aim to
help build terminal-based programs with a focus on speed and memory efficiency.
## Benchmarks
When using a buffer of sufficient capacity, `CSI.AppendFunc` can append the
CSI escape sequence without allocation.
```
benchmark iter time/iter bytes alloc allocs
--------- ---- --------- ----------- ------
BenchmarkCSI/Func-4 9971707 116.00 ns/op 24 B/op 2 allocs/op
BenchmarkCSI/FuncString-4 8935776 135.00 ns/op 32 B/op 3 allocs/op
BenchmarkCSI/AppendFunc-4 20534767 58.80 ns/op 0 B/op 0 allocs/op
BenchmarkCSI/DecodeArgs-4 20537282 55.00 ns/op 0 B/op 0 allocs/op
```
## License
The [BSD 3-Clause license][bsd].
[bsd]: http://opensource.org/licenses/BSD-3-Clause
[godoc]: http://godoc.org/git.sr.ht/~mna/zzcsi
[pgd]: https://pkg.go.dev/git.sr.ht/~mna/zzcsi
[xterm]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_
[zzt]: https://git.sr.ht/~mna/?search=zz