~mna/zzcsi

ref: 5d506636cf79d6d6fc3388b4cc5c815920bb7a45 zzcsi/README.md -rw-r--r-- 2.0 KiB
5d506636Martin Angers rename to zzcsi 1 year, 2 months ago

#zzcsi builds.sr.ht status GoDoc go.dev reference

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 for more information on CSI sequences.

See the package documentation for details, API reference and usage example (alternatively, on pkg.go.dev).

This is a package in the zzterm 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          9259478   118.00 ns/op       24 B/op   2 allocs/op
BenchmarkCSI/FuncString-4    9003938   133.00 ns/op       32 B/op   3 allocs/op
BenchmarkCSI/AppendFunc-4   20808049    58.40 ns/op        0 B/op   0 allocs/op

#License

The BSD 3-Clause license.