libspinner is a C single-header library that provides terminal spinners and progress indicators. This is a port of the Go library here.
NOTE: Be sure to call spinner_stop(s)
in any signal handlers or clean up routines so the underlying pthread doesn't leak.
An example can be found in the examples
directory.
make test
- Start
- Stop
- Restart
- Reverse direction [in progress]
- Update the spinner character set
- Update the spinner speed
- Prefix or append text
- Change spinner color, background, and text attributes such as bold / italics [in progress]
- Chain, pipe, redirect output
- Output final string on spinner/indicator completion
(cursor not visible in normal operation)
Please feel free to open a PR!
libspinner source code is available under the BSD 2 clause License.